<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- Mobile Devices Support @begin -->
<meta content="application/xhtml+xml;charset=UTF-8" http-equiv="Content-Type">
<meta content="no-cache,must-revalidate" http-equiv="Cache-Control">
<meta content="no-cache" http-equiv="pragma">
<meta content="0" http-equiv="expires">
<meta content="telephone=no, address=no" name="format-detection">
<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0" />
<meta name="apple-mobile-web-app-capable" content="yes" /> <!-- apple devices fullscreen -->
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
<title>玩游戏赢大奖</title>
<link href="css/base.min.css?v=201609201747" rel="stylesheet" type="text/css" />
<link href="css/bbtzw.min.css?v=201605161742" rel="stylesheet" type="text/css" />

<script type='text/javascript'>
    var g_rem = 20;
    (function(docElem,win){
        var setFontSize = function(){
            g_rem = (docElem.getBoundingClientRect().width || docElem.clientWidth || win.innerWidth)/16;
            !g_rem && (g_rem = 20);
            docElem.style.fontSize = g_rem + 'px';
        }
        win.addEventListener("resize",setFontSize,false);
        setFontSize();
    })(document.documentElement,window);
    
    function loadGamePreAssets(){}
</script>
<script type="text/javascript" src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
</head>
<body class="gameTpl_-1">


<!-- loading页面 -->
    <div id="preloadPage" class="bg">
        
        <div class="spinner">
          <div class="spinner-container container1">
            <div class="circle1"></div>
            <div class="circle2"></div>
            <div class="circle3"></div>
            <div class="circle4"></div>
          </div>
          <div class="spinner-container container2">
            <div class="circle1"></div>
            <div class="circle2"></div>
            <div class="circle3"></div>
            <div class="circle4"></div>
          </div>
          <div class="spinner-container container3">
            <div class="circle1"></div>
            <div class="circle2"></div>
            <div class="circle3"></div>
            <div class="circle4"></div>
          </div>
        </div>
        
        <div class="info"><span id="loadPercent">0</span>%</div>
        <div id="userPreload" data-src="http://7020498.h40.faiusr.com/4/MW63k3My7GO2FWfyM2M37GNzQjZ2YGN.png"></div>
    </div>

	<div class="ajaxLoadBg">
		<div class="ajaxLoadBar "></div>
	</div>
	<div class="body">
		<div class="home">
			<div id="homeBgBox">
				<img id="homeBg" src="image/bbtzw/homeBg.jpg?v=201509051300"/>	
			</div>	
			<div class="gameInfoBox">
				<div class="titleImg imgContainer absCenter">
					<img id="titleImg" class="slaveImg abs" src="image/bbtzw/title.png?v=201509051300" style="width:15.25rem;height:7.5rem;top:0.8rem;left:0.35rem;"/>
				</div>
			</div>	
			

	<div id='joinNumLine' class='joinNumLine absCenter' style='top:18rem;left:3.6rem;color:rgb(18, 75, 179);font-size:0.7rem; text-shadow:rgb(255, 255, 255) -1px -1px 0px, rgb(255, 255, 255) 0px -1px 0px, rgb(255, 255, 255) 1px -1px 0px, rgb(255, 255, 255) 1px 0px 0px, rgb(255, 255, 255) 1px 1px 0px, rgb(255, 255, 255) 0px 1px 0px, rgb(255, 255, 255) -1px 1px 0px, rgb(255, 255, 255) -1px 0px 0px;'>
	已有 <span id='joinNum' class="specil" style="color:rgb(254, 194, 0);font-size:0.7rem;text-shadow:rgb(255, 255, 255) -1px -1px 0px, rgb(255, 255, 255) 0px -1px 0px, rgb(255, 255, 255) 1px -1px 0px, rgb(255, 255, 255) 1px 0px 0px, rgb(255, 255, 255) 1px 1px 0px, rgb(255, 255, 255) 0px 1px 0px, rgb(255, 255, 255) -1px 1px 0px, rgb(255, 255, 255) -1px 0px 0px;">1</span> 人参加活动</div>

			<div id="startBtn" class="startBtn imgContainer absCenter" style="top:0rem;">
				<img id="startBtnImg" class="slaveImg abs" src="image/bbtzw/startBtn.png?v=201509051300" style="width:7rem;height:2.75rem;top:19.9rem;left:4.5rem;"/>
			</div>			
		</div>
		<div class="gameBox hide gameBgBox">
			<div id="gameBgBox">
				<img id="gameBg" src="image/bbtzw/gameBg.jpg?v=201509081300" style="width:100%;height:auto;"/>	
			</div>
            
<div id="gameTopBar" class="gameTopBar" style="color:rgb(255, 255, 255);background-color:transparent">
	<div class="userInfoBox">
		<div  class="userImgBox" style="border-color:rgba(255, 255, 255, 0.298)"><img src="http://wx.qlogo.cn/mmopen/Q3auHgzwzM4DJfovSJCqebsianIvGcX6HWPFI2bROl3z9B2Bl4iavR5dfIjOqYojfvLNM8uBlkBkZ5G9MhmzcN8j2bQBnkRicEiac449loHwTsE/0" class="userImg" /></div>
					
			<div id="grade" class="grade">0</div>
			
	</div>

	<div class="timeBox">
		时间<br><span class="time">0</span>
	</div>
</div> 
			<div id="gameLayerBox" class="editTarget-wrap">
                
			</div>
            <div class="timeUpImg hide"></div>
		</div>
        
<div id="spxdPage"></div>
<!-- 活动规则，排行榜，我的奖品的弹出层 -->
<div class="ruleImg imgContainer absCenter" _mouseIn="0" ontouchend="showRule();">
    <img id="ruleImg" class="slaveImg abs" src="image/ruleImg_blue.png?v=2016091816" style="width:3rem;height:3rem;top:0.15rem;left:12.85rem;"/>
</div>
<div id="poupInfoBox"> 
	<div class="poupHead">
        <div class="poupTitleBox">
            <div id="actionExpBtn" class="poupTitleMune checked" _flag="2">
                <div class="item">活动说明</div>
            </div>
             
            <div id="ranBtn" class="poupTitleMune " _flag="1">
                <div class="item">排行榜</div>
            </div>
            
            <div id="prizeBtn" class="poupTitleMune" _flag="3">
                <div class="item">我的奖品<span id='Award_Round_Dot' class='redDot hide'></span></div>
            </div>   
            <div id="winnerBtn" class="poupTitleMune hide" _flag="4">
                <div class="item">获奖名单</div>
            </div>
            <div class="poupSlideBar">
                <div class="slideBarTip transitionPanel"></div>
            </div>
        </div>
        <div class="poupClose"></div>
        <div style="clear:both; height:0"></div>
		<!--<div class="poupTitle">活动及奖品说明</div>-->
	</div>
    <div id="popTabBox" class="popTabBox transitionPanel" style="left:0">
    	<div id="ruleBox" class="poupMain" _flag="2" style="-webkit-overflow-scrolling:touch;">
    		<div id="getHeight">
    			<div id="awardLine" class="poupLine">
                    <div class="mainTitle">活动奖品</div>
                    <div id="awardLineBox">
    				<div class='unComfortLine awardItem '><span class='awardStyle'>一等奖</span> : <span class='award'>价值100元礼品</span></div>
<div class='unComfortLine awardItem '><span class='awardStyle'>二等奖</span> : <span class='award'>价值50元礼品</span></div>
<div class='unComfortLine awardItem '><span class='awardStyle'>三等奖</span> : <span class='award'>价值10元礼品</span></div>
<div class='unComfortLine awardItem hide'><span class='awardStyle'>四等奖</span> : <span class='award'>价值5元小礼品</span></div>
<div class='unComfortLine awardItem hide'><span class='awardStyle'>五等奖</span> : <span class='award'>价值5元小礼品</span></div>
<div class='unComfortLine awardItem hide'><span class='awardStyle'>六等奖</span> : <span class='award'>价值5元小礼品</span></div>
<div class='unComfortLine awardItem hide'><span class='awardStyle'>七等奖</span> : <span class='award'>价值5元小礼品</span></div>
<div class='unComfortLine awardItem hide'><span class='awardStyle'>八等奖</span> : <span class='award'>价值5元小礼品</span></div>
<div class='awardItem anwei hide'><span class='awardStyle'>安慰奖</span> : <span class='award'>价值5元小礼品</span></div>

					</div>	
                <div id="selfAwardLine" class="hide" style="word-wrap: break-word;"></div>
    		</div>		
    			<div id="gameDateTime" class="poupLine">
                    <div class="mainTitle">活动时间</div>
    				<p><span id="startDate">2016年9月22日 15:36</span>&nbsp;-&nbsp;<span id="endDate">2016年9月30日 15:36</span></p>
    			</div>	
                <div class="hostLine poupLine">
                    <div class="mainTitle">主办单位</div>
                    <p>本次活动主办单位为 <a class="hostName" href="http://" />zhanglang108</a></p>
                    <p>主办单位在法律允许的范围内拥有活动解释权</p>
                </div>
                
                    <div id="skillLine" class="skillLine poupLine">
                        <div class="skillCont">
                            <div class="mainTitle">技术支持</div>
                            <p>页面技术由 <a class="skillName"  href="http://mp.weixin.qq.com/s?__biz=MjM5MTk5MjI3OA==&mid=209854000&idx=1&sn=82241d924839270d3ea820ad2d56c01b#wechat_redirect" />凡科互动</a> 提供，技术支持方仅提供页面技术，不承担由活动引起的相关法律责任</p>
                        </div>
                    </div>
                
    		</div>	
    		<div id="explainBox" class="poupLine">
                <div class="mainTitle">活动及兑奖说明</div>
                
                    <p id="explaiDrawInfoBox">
                        <span id="haveScore">游戏达到 <span id="scoreLimit" class="scoreLimit">50</span><span class="gameScoreUnit">分</span><span id="exlainDrawFont">即可获得抽奖机会，</span></span>
                        
                        <span id="directDrawInfoBox" class="">
                            每人<span class="dayFont">每日</span>有 <span id="drawTimesLimit">3</span> 次抽奖机会<span class="drawTotalFont">，每人最多可抽奖 <span id="totalDrawTimeLimit">6</span> 次</span>。<br>
                        </span> 
                        
                    </p>
                		
    			<div id="exlainInfo">获奖后凭兑奖码联系活动主办单位即可兑奖。</div>
    		</div>
    	</div>
    	<div id="rankBox" class="poupMain" _flag="1" style="-webkit-overflow-scrolling:touch;" >
    		<div id="noRank" class=''>暂无排名</div>
    		<div id="rankMain" class="getRankHeight hide">
    			<div style="margin-top:0.7rem;margin-left: 0.25rem;">当前排名：<span id="rank"></span> （只显示前<span id="showRankNum">100</span>名）</div>
    			<div style="padding:0rem 0.5rem">					
    				<table class="rankTable" cellspacing="0" cellpadding="0">
    					<thead>
    						<tr style="line-height: 1rem;">
    							<th>排行</th>
    							<th>头像</th>
    							<th>昵称</th>
    							<th>成绩</th>
    						</tr>
    					</thead>		
    				</table>
    			</div>
    		</div>		
    		<div id="rankHeight">
    			<table id="rankInfoBox" class="rankTable" cellspacing="0" cellpadding="0" style="margin-top: 0;"></table>
    		</div>				
    	</div>
    	<div id="awardBox" class="poupMain" _flag="3" >
            <div id="awardInfo" style="height: 16rem; overflow-y: auto;">暂无中奖纪录</div>    
            <div class='attentionBox'>
                <div class='menuBtnBox' >
                    <a class='menuName'>关注我们</a>
                </div>
                
                <div class='skillInfo'><a href='http://mp.weixin.qq.com/s?__biz=MjM5MTk5MjI3OA==&#x26;mid=209854000&#x26;idx=1&#x26;sn=82241d924839270d3ea820ad2d56c01b#rd'>我也要免费创建活动</a><span class='gotoFlag'></span></div>
                <div class='holdBox'></div>
            </div>
        </div>
    	<div id="regAwardBox" class="poupMain" _flag="4" style="-webkit-overflow-scrolling:touch;">
    		<div id="noRegAward" class="hide" style="margin-left:3px;">尚未公布获奖名单，详情请查看活动说明</div>

    		<div id="regAwardMain" style="display:none;">         
    					
    					<div class="regAwardList">
    						<div class="mainTitle">一等奖</div>
    						<div class="playerName" style="margin-bottom:12px;"></div>
    					</div>	
    					
    					<div class="regAwardList">
    						<div class="mainTitle">二等奖</div>
    						<div class="playerName" style="margin-bottom:12px;"></div>
    					</div>	
    					
    					<div class="regAwardList">
    						<div class="mainTitle">三等奖</div>
    						<div class="playerName" style="margin-bottom:12px;"></div>
    					</div>	
    			
    		</div>	
    	</div>	
    </div>
</div>
<!-- 兑奖联系方式弹出层 -->
<div id="awardUserInfoBg" class="bg hide" style="position:fixed;overflow: scroll;">
	<div id="awardUserInfoBox">
		<div class="title">领奖信息</div>
		<div class="awardTips">获奖者需填写联系电话方可查看兑奖码兑奖</div>
		<div>
			<input id="nameInput" class="contactInput" type="text" placeholder="请输入姓名" />
			<input id="phoneInput" class="contactInput" type="text" placeholder="请输入联系电话" />
            <textarea id="addressInput" class="contactInput" name="address" placeholder="请输入联系地址"></textarea>
			<div id="userSubmitBtn" class="submit">提交</div>
			<div id="userCancelBtn">暂不提交</div>
		</div>
		<div class="awardUserBot">若因未填写资料或资料填写错误导致兑奖失败<br>主办方不承担相关法律责任</div>
	</div>
</div>
<!--奖品详情弹出层 -->
<div id="awardDetailBox" class="poupMain bg hide">
	<div id="awardDeailBg" class="bg hide"></div>
	<div class="awardCloseIcon"></div>
	<div class="awardDetail">
		<div class="hostName" style="padding: 0.7rem 0.7rem 1rem;text-align: left;color:#fff"></div>
		<div class="awardName ellipsis"></div>
		<div class="awardSubTitle"></div>
		<div class="awardCodeTime"><em>使用期限</em>：<span class="codeBgTime"></span> - <span class="codeEndTime"></span></div>
		<div class="awardDetailWarp"></div>
	</div>
	<div class="codeImgBox">
		<div id="codeStatusBox" class="hide" style="padding-top:1.25rem;color:#777">
			<div id="codeStatusBtn"></div>
			<div id="codeStatusInfo">商家已将该兑奖码设置为作废<br>详情请联系商家</div>
            <div id="codeStatusTips" class="hide"><em style="font-style: normal;">请先收藏<span class="giftNameA">兑奖券</span>，<span class="targetDateMin">1</span>天后可用</em></div>
		</div>
		<div id="codeDetailInfoBox">
			<img class="codeImg"/>
			<div class='codeLine'><span id="codeName">优惠码</span>：<span class="code"></span></div>
			<div class="codeOptInfo"></div>
		</div>	
	</div>
	<div class="hide bg codeDetailImgBox">
		<div class="absCenter imgBox">
			<img class="codeImg" style="width:9rem;height:9rem;"/>
		</div>
	 </div>
	<div>
		<div style="height:0.4rem;"></div>
		<div>
            <div class="awardCusText awardDetailBtn"><span class="text">自定义文本<em>（未开启）</em></span><span class="awardDeailIcon"></span></div>
            <div id="awardCusTextInfo" class="awardDetailText hide"></div>
            <a id="awardCusBtnInfo" href="###" style="text-decoration:none;"><div class="awardCusBtn awardDetailBtn" style="border-top:none;"><span class="text">自定义按钮<em>（未开启）</em></span><span class="awardDeailIcon"></span></div></a>
		</div>
		<div style="height:2.75rem;"></div>
		<div class="awardCollection">
			<div id="awardCollectionBtn" ontouchend = "HdGame.favorite();">收藏优惠券</div>
		</div>
	</div>	
</div>
<!--兑奖券详情弹出层 -->
<div id="ticketDetailBox" class="poupMain bg hide">
    <p class="ticketitle"><span class="closeBtn"></span><span class="text">兑奖券详情</span></p>
    <div class="ticketInfo">
        <div class="itemList">
            <div class="title">有效日期</div>
            <div class="box">
                <span class="beginTime">2016.03.03</span>-<span class="endTime">2017.03.03</span>
            </div>
        </div>
		<div class="itemList">
            <div class="title">可用时段</div>
            <div class="box">
                <div class="timelimit">周一至周日</div>
            </div>
        </div>
        <div class="itemList addressLine">
            <div class="title titleAdress">兑奖地址</div>
            <div class="box">
                <div class="address">地址</div>
            </div>
        </div>
        <div class="itemList">
            <div class="title">客服电话</div>
            <div class="box">
                <div class="tel">1356969585</div>
            </div>
        </div>
        <div class="itemList">
            <div class="title titleNotice">兑奖须知</div>
            <div class="box">
                <div class="notice">XXXXXX</div>
            </div>
        </div>
    </div>
</div>
<!--投诉页面弹出层 -->
<div id="informBox" class="bg hide">
    <div id="inform-reason-page">
        <p class="informTitle">请选择投诉原因</p>
        <div id="inform-reason-box">
            <div id="temptShare" class="reasonItem" _index="0">诱导分享<em></em></div>
            <div id="shamActive" class="reasonItem" _index="1">虚假活动<em></em></div>
            <div id="political" class="reasonItem" _index="2">政治敏感<em></em></div>
            <div id="eroticism" class="reasonItem" _index="3">色情低俗<em></em></div>
            <div id="rumor" class="reasonItem" _index="4">谣言<em></em></div>
            <div id="otherReason" class="reasonItem" _index="5">其他（收集隐私信息等）<em></em></div>
        </div>
        <div id="cancel-inform-btn">取消</div>
        <div id="next-inform-btn" class="hide">下一步</div>
        <div id="inform-poup-tip" class="hide">投诉成功</div>
    </div>
    <div id="inform-desc-page" style="display: none;">
        <p class="informTitle">投诉描述</p>
        <div id="inform-desc-box">
            <textarea name="informDesc" id="informDesc" cols="30" rows="6" placeholder="请填写投诉描述，最多输入50个字"></textarea>
        </div>
        <div id="submit-inform-btn">提交</div>
    </div>
</div>
<!--投诉结果页面弹出层 -->
<div id="informResultBox" class="bg hide">
	<img src="image/gx.png?v=201604151202">
	<h3>投诉成功</h3>
	<p>感谢你的参与，我们坚决反对色情、暴力、欺诈等违规信息，我们会认真处理你的投诉，维护绿色、健康的网络环境</p>
	<div class="confirm-btn">确认</div>
</div>
<!-- 右侧按钮 -->
<div class="homeBtnBox">
    
	<div id="myAwardBtn" ontouchend="HdGame.changePoup(3)" style="display:none;"><span class='redDot'></span></div>
    <div id="informBtn" ontouchend="HdGame.changePoup(5)">
        <span>投诉</span>
    </div>
</div>
<!-- logo -->
<div id="logoImgBox" class="logoImgBox imgContainer absCenter hide" >
    <img id="logoImg" class="slaveImg abs" src="image/logo.jpg" style="width:2rem;height:2rem;top:3.5rem;left:0.75rem;"/>
</div>
<!-- 抽奖等待弹出层 -->
<div id="lots-wait-Box" style="display:none">
	<div id="lots-wait-img"></div>
	<div id="lots-wait-hint">当前抽奖人数过多<br/>请稍等 <span id="lots-wait-hint-num">0</span> 秒</div>
</div>
<!-- 助力引导层 -->
<div id="helpGuideBox" style="display:none">
	<p>你今天已经没有抽奖机会了</br>分享给好友或群聊</p>
	<p style="margin-top:1.1rem;">今天将额外获得1次抽奖机会！<br/>（仅限当天首次分享）</p>
</div>
<!--
<div id="jv_dev_box" style="position:fixed;top:0;bottom:0;right:0;margin:auto;display:table;width:2rem;background-color:rgba(0,0,0,.3);color:#fff;">
	<div id="jv_share_btn" style="text-align:center;line-height:2;border-bottom:1px solid #fff;">share</div>
</div>
-->
<!-- 结果弹出层 -->
<div class="resuleBox hide">

    <div id="resule-status-box" style="display:none">
        <div id="resule-status-scrollWrap">
            <div class="resule-bgLight"></div>
            <div id="resule-status-bird"></div>
            <div id="resule-status-head">
                <div class="resule-status-userImg one" style="display: none;">
                    <img src="http://wx.qlogo.cn/mmopen/Q3auHgzwzM4DJfovSJCqebsianIvGcX6HWPFI2bROl3z9B2Bl4iavR5dfIjOqYojfvLNM8uBlkBkZ5G9MhmzcN8j2bQBnkRicEiac449loHwTsE/0"/>
                </div>
                <div class="resule-status-userImg PKner-A hide">
                	<img />
                </div>
                <div class="PKner-B hide">
                	<img src="image/jtou.png"/>
                </div>
                <div class="resule-status-userImg PKner-C hide">
                	<img src="http://wx.qlogo.cn/mmopen/Q3auHgzwzM4DJfovSJCqebsianIvGcX6HWPFI2bROl3z9B2Bl4iavR5dfIjOqYojfvLNM8uBlkBkZ5G9MhmzcN8j2bQBnkRicEiac449loHwTsE/0"/>
                </div>
                <p class="userA-name hide">haha</p>
                <p class="userB-name hide">小旋风</p>
                <div id="resule-status-ribbon" class="resule-status-ribbon"></div>
            </div>
			<div id="resule-status-body">
                
				<p class="youraward"style="font-size:0.8rem; line-height:1.2rem">您的成绩为：<span class="resuleArg" style="font-size:0.8rem;"></span><span class="result-scoreUnit"><span class="gameScoreUnit">分</span></span></p>
				<p class="beat-Percent hide">成功击败全国<span></span>%的玩家</p>
				<p class="resule-status-minscore" style="display:none;">成绩必须达到 <span class="resuleArg resulescoreLimit"></span> <span class="gameScoreUnit">分</span>才能<span id="minscoreDrawFont">抽奖</span></p>
				
				<p id="bestArg" style="margin-top:0.5rem">最佳成绩为：<span class="resuleArg"></span><span class="result-scoreUnit"><span class="gameScoreUnit">分</span></span></p>
				<p>最佳排名为：<span class="result-scoreUnit">NO.</span><span class="resuleArg"></span></p>
				
				<div id="rank_showRule" style="text-decoration:underline;margin:0.7rem 0rem;" class="hide" ontouchend="showRule();">活动规则</div>
				<div id="resule-status-count" style="margin-top:0.6rem">
					<p class="totalDraw">您还有 <span id="totalDrawCount" class="resuleArg"></span> 次抽奖机会</p>
					<p class="dayDraw">今天还有 <span class="resuleArg dayDrawCount"></span> 次机会抽奖</p>
					<p class="dayDraw4Total hide">今天可抽 <span class="resuleArg dayDrawCount"></span> 次</p>
				</div>	
				<div class="little-PK hide">
					<p class="fighter-B"></p>
					<p class="othergrade">最佳成绩<span class="resuleArg"></span><span class="gameScoreUnit"><span class="gameScoreUnit">分</span></span></p>
					<p id="rankB">全国排名NO.<span class="resuleArg"></span></p>
					<p class="WhetherAward"></p>
					<p class="winAWard" style="margin:1rem 0">
						<a href="javascript:void(0)">活动奖品</a>
					</p>
				</div>
			</div>
			<div id="resule-status-other" class="hide">
				<p style="font-size:0.8rem;font-weight:bold;">通关并且</p>
				<p class="resule-status-minscore hide" style="margin: 10px 0px 50px;">成绩必须达到 <span class="resuleArg resuleArg-fail resulescoreLimit"></span> <span class="gameScoreUnit">分</span>才能抽奖</p>
			</div>
			<div id="resule-sucReg" class="hide" style="margin-top:0.6rem">您已经成功报名参与活动！</div>
            <div id="resule-foot-box">				
                <div class="resule-foot-one">
                    <div class="resule-button resule-one-button resule-status-gift hide">赶紧去抽奖</div>
                    <div class="resule-button resule-one-button resule-status-reg hide">我要报名</div>
                    <div class="resule-button resule-one-button resule-status-again hide">再玩一次</div>
                    <div class="resule-button resule-one-button resule-status-send hide">领取礼品</div>
                    <div class="resule-button resule-one-button resule-status-rightNow hide">马上PK</div>
                </div>
                <div class="resule-foot-two">
                
                    <div class="resule-button resule-status-seeRank">排行榜</div><div class="resule-button resule-status-home">返回首页</div><div class="resule-button resule-status-again restart-again ">再玩一次</div><div class="hide resule-button resule-status-firstPage">首页</div>
                
                </div>
            </div>
        </div>
        <div id="resule-status-lotsBox" style="display:none">
            <div id="resule-status-lots"></div>
            <div id="resule-status-lotsHand"></div>
        </div>
		<div class='attentionBox'>
			<div id="drawMenuBtnBox" class='menuBtnBox hide' >
			    <a class='menuName'>关注我们</a>
			</div>
			<div class='skillInfo'><a href='http://mp.weixin.qq.com/s?__biz=MjM5MTk5MjI3OA==&#x26;mid=209854000&#x26;idx=1&#x26;sn=82241d924839270d3ea820ad2d56c01b#rd' style='color:#fff;text-decoration:underline;'>我也要免费创建活动</a><span class='gotoFlag'></span></div>
			<div class="holdBox"></div>
		</div>
    </div>

    <div id="resule-gift-box" style="display:none">
        <div id="resule-gift-scrollWrap" class="resule-gift-overflowScrolling" style="padding-top: 1.2rem;">
            
                <div class="resule-bgLight"></div>
            
            <!--<div id="resule-gift-jiantou" class="resule-fxts resule-fxts_s"></div>-->
            <div style="position:absolute; width: 100%;z-index:250;">
                <p id="resule-gift-luck" style="text-align:center;" >恭喜你获得了</p>
                <div class="imgContainer">
                        <img id="resule-gift-sucImg" class="slaveImg" src="image/gift.png?v=201504091029" style="width:6rem;height:6rem">
                    
                </div>
                <div id="resule-gift-foot">
                    <p id="resule-gift-rank"> <span class="gifArg awardStyle"></span> </p>
                    <p id="resule-gift-goods"> <span class="gifArg awardName"></span> </p>
                    <!--<p id="resule-gift-code" >兑奖码：<span class="gifArg"></span></p>-->
					<a id="resulte-gift-showMyAward" style="text-decoration: underline;color:#fff;">点击查看奖品详情</a>
                    <!--<p id="resule-gift-explain" style="text-align:left;" >获奖后凭兑奖码联系活动主办单位即可兑奖。</p>-->
                </div>
            
            </div>
        </div>
    
        <!--<div id="faiImgBox" class="imgContainer absCenter hide" >
            <img id="resule-faiImg" class="slaveImg abs" src="image/bbtzw/faiImg.png" style="width:15rem;height:18rem;top:0.5rem;left:0.5rem;"/>
        </div>-->
        <div id="faiImgBox">
            <img class="abs" src="image/faiImg.png?v=201509171041" style="width:13.5rem;height:16.75rem;top:2.0rem;left:1.2rem;"/>
    
    
            <div class='resule-gift-draw repeatDraw'>继续抽奖</div>
            <div class='resule-gift-home menuBack menuBack2'>返回首页</div>
        
    
    </div>
    
        <div class='attentionBox'>
            <div class='menuBtnBox'>
              <a class='menuName'>关注我们</a>
            </div>
            <div class='skillInfo'><a href='http://mp.weixin.qq.com/s?__biz=MjM5MTk5MjI3OA==&#x26;mid=209854000&#x26;idx=1&#x26;sn=82241d924839270d3ea820ad2d56c01b#rd'>我也要免费创建活动</a><span class='gotoFlag'></span></div>
            <div class="holdBox"></div>
        </div>
    </div>
</div>

<!-- 一键关注弹出页 -->
<div id="attentionMask" class="homePoupMask">
    <div id="attentionPoup" class="homePoupInner attentionPoup">
        <img src="image/caewm.jpg?v=201506151818"/>
        <img id="QRImg" src="" style="position:absolute;top:0.5rem;left:0;right:0;margin:auto;"/>
    </div>
</div>

<!--卡券一键关注弹出页-->
<div id="newAttentionMask" class="homePoupMask hide">
    <div id="newAttentionPoup" class="homePoupInner attentionPoup">
        <img src="image/caewm.jpg?v=201506151818"/>
        <img id="QRImg_1" style="position:absolute;top:0.5rem;left:0;right:0;margin:auto;"/>
    </div>
</div>
<!-- 运营账号弹出页 -->


    <!-- 技术支持弹出页 -->
    <div id="skillSupMask" class="homePoupMask">
        <div id="skillSupPoup" class="homePoupInner attentionPoup">
            <img src="image/yxcaewm.jpg?v=201602221653" style="width:10.7rem;position: absolute;top: 0.2rem;left: 0;right: 0;margin:auto"/>
            
            <img src="image/nbuyhd.gif?v=201602221653" style="position:relative;"/>
            
        </div>
    </div>



	</div>
<script type="text/javascript">
    function loadGamePreAssets(){
        hg.assets.add("image/bbtzw/tishi.png");
    }
</script>

<script type="text/javascript">
    var _manage = false,
        m_debug = false, 
        _resRoot = '//hdg.faisys.com',
        hg = {};
    //错误监控
    (function(){var _faiAjax=function(){var r=/\?/;var _o={type:"get",url:"",data:"",error:function(){},success:function(){}};var _sendRequest=function(o){var xmlhttp=null;o.type=o.type||_o.type;o.url=o.url||_o.url;o.data=o.data||_o.data;o.error=o.error||_o.error;o.success=o.success||_o.success;if(window.XMLHttpRequest){xmlhttp=new XMLHttpRequest()}else{xmlhttp=new ActiveXObject("Microsoft.XMLHTTP")}if(o.type!="post"){o.url+=(this.r.test(o.url)?"&":"?")+o.data;xmlhttp.open("GET",o.url,true);xmlhttp.onreadystatechange=function(){if(xmlhttp.readyState==4&&xmlhttp.status==200){o.success(xmlhttp.responseText)}else{if(o.error){o.error()}}};xmlhttp.send()}else{xmlhttp.open("POST",o.url,true);xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded; charset=UTF-8");xmlhttp.onreadystatechange=function(){if(xmlhttp.readyState==4&&xmlhttp.status==200){o.success(xmlhttp.responseText)}else{o.error()}};xmlhttp.send(o.data)}};return{ajax:function(option){try{_sendRequest(option)}catch(e){}}}}();hg._faiAjax=_faiAjax;var _jsErrCahche=[];window.onerror=function(sMsg,sUrl,sLine){if(sLine<1||typeof sMsg!="string"||sMsg.length<1){return}if(/WeixinJSBridge|_WXJS/.test(sMsg)){return}var log="Error:"+sMsg+";Line:"+sLine+";Url:"+sUrl;var alertLog="Error:"+sMsg+"\n"+"Line:"+sLine+"\n"+"Url:"+sUrl+"\n";var encodeUrl=function(url){return typeof url==="undefined"?"":encodeURIComponent(url)};var ajax=true;var obj={"m":sMsg,"u":sUrl,"l":sLine};for(var i=0;i<_jsErrCahche.length;i++){if(_jsErrCahche[i].m==obj.m&&_jsErrCahche[i].u==obj.u&&_jsErrCahche[i].l==obj.l){ajax=false;break}}if(ajax){_jsErrCahche.push(obj);_faiAjax.ajax({type:"post",url:"//hd.faisco.cn/ajax/logJsErr_h.jsp?cmd=jsErr",data:"msg="+encodeUrl(log)})}if(m_debug){if(HdGame&&HdGame.tlog){HdGame.tlog(alertLog)}else{alert(alertLog)}}}})();
    /*
    hg.assets  : {
          complete
          loadComplete
          onReady
          onload
          loadPage
        }
    */
    function isArray(arr){
        return Object.prototype.toString.call(arr) === "[object Array]";
    }
    (function(hg){
        var imgPaths = [],
            readyCallBack = [],
            loadCallBack = [];
        hg.assets = {
            complete : false,
            loadComplete : false,
            increment : 10,
            loadingStyle : 1,
            loadTimeout : 120000,
            add : function(src){     
                var self = this;
                if(self.complete || _manage){
                    return;
                }
                if(isArray(src)){
                    for (var i = src.length - 1; i >= 0; i--) {
                        self.add(src[i]);
                    };
                }else if(typeof src === 'string'){
                    imgPaths.push(src);
                }
                return this;
            },
            onReady : function(callBack){
                var self = this;
                if(self.complete){
                    callBack();
                }else{
                    readyCallBack.push(callBack);
                }
                return self;
            },
            onload  : function(callBack){
                var self = this;
                if(self.loadComplete){
                    callBack();
                }else{
                    loadCallBack.push(callBack);
                }
                return self;
            },
            loadPage : function(){if(_manage)return;var self=this,percent=1,numLoaded=0,$loadPercent=document.getElementById("loadPercent"),loadPallet;window.scrollTo(0,0);if(self.loadingStyle===1){loadimg(imgPaths)}else if(self.loadingStyle===3){var logoImg=document.getElementById("preloadImg");if(logoImg.complete){initLogoImg()}else{logoImg.onload=initLogoImg}function initLogoImg(img){var img=logoImg;var h=img.height;var w=img.width;var bottomPageInfoDeg=-Math.atan(w/h)-Math.PI/2;var canvas=document.getElementById("preloadCanvas");var ctx=canvas.getContext("2d");var ratio=(window.devicePixelRatio||1)/(ctx.backingStorePixelRatio||ctx.webkitBackingStorePixelRatio||ctx.mozBackingStorePixelRatio||ctx.msBackingStorePixelRatio||ctx.oBackingStorePixelRatio||ctx.backingStorePixelRatio||1);var drawImg=function(){ctx.fillStyle="#fff";ctx.fillRect(0.2*g_rem*ratio,0.2*g_rem*ratio,w*ratio,h*ratio);ctx.drawImage(img,0.2*g_rem*ratio,0.2*g_rem*ratio,w*ratio,h*ratio)};if(h===w){if(h>3.5*g_rem){h=w=3.5*g_rem}drawImg=function(){ctx.save();ctx.beginPath();ctx.arc(canvas.width/2,canvas.height/2,w/2*ratio,0,2*Math.PI);ctx.clip();ctx.fillStyle="#fff";ctx.fill();ctx.drawImage(img,0.2*g_rem*ratio,0.2*g_rem*ratio,w*ratio,h*ratio);ctx.restore()}}else{if(w>h&&w>8*g_rem){h=8*g_rem*h/w;w=8*g_rem}else{if(h>w&&h>8*g_rem){w=8*g_rem*w/h;h=8*g_rem}}}canvas.width=(w+0.4*g_rem)*ratio;canvas.height=(h+0.4*g_rem)*ratio;canvas.style.width=w+0.4*g_rem+"px";canvas.style.height=h+0.4*g_rem+"px";if(h===w){ctx.beginPath();ctx.arc(canvas.width/2,canvas.height/2,canvas.width/2,0,2*Math.PI);ctx.clip()}ctx.strokeStyle="#69c5ff";ctx.lineWidth=8*g_rem*ratio;loadPallet=function(tmp){ctx.beginPath();ctx.arc(canvas.width/2,canvas.height/2,4*g_rem*ratio,bottomPageInfoDeg,bottomPageInfoDeg+tmp*(2*Math.PI/100));ctx.stroke();drawImg()};loadimg(imgPaths)}}function setPercent(percent){$loadPercent.innerHTML=percent;if(percent===100){var index=0;setTimeout(function(){index++;if(index<10){loadPallet&&loadPallet(120);setTimeout(arguments.callee,17)}else{loadPallet=null}},17)}loadPallet&&loadPallet(percent)}function loading(){if(numLoaded<imgPaths.length){if(percent<100-imgPaths.length+numLoaded){percent++;setPercent(percent-1)}}else{percent+=10;percent>100&&(percent=100);setPercent(percent-1)}if(percent>=100&&typeof $!='undefined'){setPercent(100);var flag=$(window).height()/$(window).width()<1.575;var bgHeight=flag?$(window).width()*1.575:$(window).height();setTimeout(function(){$("#preloadPage").addClass("leftClose");$("#homeBgBox,.gameBgBox").css("height",bgHeight/g_rem+"rem");flag&&$(".home .bottomSkill,#bottomSkill").css("top",(bgHeight-$(".bottomSkill").outerHeight())/g_rem+"rem");setTimeout(function(){$loadPercent=null;$("#preloadPage").hide()},500);complete();self.loadComplete=true;for(var n=loadCallBack.length,i=0;i<n;i++){loadCallBack[i]()}loadCallBack=null;logoImg=null;$loadPercent=null},300);return}setTimeout(arguments.callee,10)}function loadimg(arr){loading();for(var i=arr.length-1;i>=0;i--){var img=new Image();img.onload=loadCheckComplete;img.onerror=loadCheckComplete;img.src=arr[i];self[arr[i]]=img}if(self.loadTimeout){self._loadTimer=setTimeout(loadTimeout,self.loadTimeout)}}function loadTimeout(){}function loadCheckComplete(){numLoaded++;this.assets_complete=true;if(numLoaded===imgPaths.length){complete()}}function complete(){if(self.complete)return;clearTimeout(self._loadTimer);numLoaded=imgPaths.length;self.complete=true;for(var n=readyCallBack.length,i=0;i<n;i++){readyCallBack[i]()}readyCallBack=null}}
        };
    })(hg);
    /*----------------------------可编辑元素包装------------------------------------*/
    hg.edit = null;
    
    hg.edit = {};
    //通过conf文件配置可编辑元素的属性
    (function(hg){
        var origin = [{"name":"ySugar","path":["image/bbtzw/ySugar.png"]},{"name":"club","path":["image/bbtzw/club.png"]},{"name":"bSugar","path":["image/bbtzw/bSugar.png"]},{"name":"wrap"}];
        var originDef = [{"name":"ySugar","path":["*_resRoot*/image/bbtzw/ySugar.png","黄色糖","50k"]},{"name":"club","path":["*_resRoot*/image/bbtzw/club.png","支架","50k"]},{"name":"bSugar","path":["*_resRoot*/image/bbtzw/bSugar.png","蓝色糖","50k"]},{"name":"wrap","edit":"all"}];
        var originMod = [{"name":"ySugar","path":["image/bbtzw/ySugar.png"]},{"name":"club","path":["image/bbtzw/club.png"]},{"name":"bSugar","path":["image/bbtzw/bSugar.png"]},{"name":"wrap"}];
        
        function correct(list1,list2){
            return list2.map(function(val2){
                return list1.filter(function(val1){return val1.name === val2.name;})[0] || val2;
            });
        }
        originMod = originMod ? correct(originMod,originDef) : originMod;
        origin = originMod ? correct(origin,originMod) : correct(origin,originDef);
        //将图片放进缓存数组内
        for(var i=0;i < originDef.length;i++){
            var path = origin[i].path;
            var pathDef = originMod ? originMod[i].path : originDef[i].path;
            if(pathDef){
                if(!path){
                    origin[i].path = path = pathDef;
                }else if(!isArray(path[0]) && isArray(pathDef[0])){
                    origin[i].path = path = [].concat(pathDef).splice(0,1,path);
                }
                if(isArray(path[0])){
                    for(var j=0;j < pathDef.length;j++){
                        if(!path[j]) path[j] = pathDef[j];
                        if(!path[j][0]) path[j][0] = pathDef[j][0];
                        hg.assets.add(path[j][0].replace('*_resRoot*',_resRoot));
                    }
                }else{
                    if(!path[0]) path[0] = pathDef[0];
                    hg.assets.add(path[0].replace('*_resRoot*',_resRoot));
                }
            }
        }
        if(false && origin[1].path[0] == _resRoot + "/image/tgcm/answer.png"){
            origin[1].path[0] = [_resRoot + "/image/tgcm/drag.png"];
        }
        hg.edit.origin = origin;
        hg.edit.originDef = originDef;
        hg.edit.originMod = originMod;
    })(hg);
    
    /*-----------------------资源loading-----------------------------*/
    //存放所有loading好的image对象,src为key
    hg.assets.add([
        "image/bbtzw/homeBg.jpg?v=201509051300",
        "image/logo.jpg",
        "image/ruleImg.png",
        "image/success.png",
        "image/light.png",
        "image/bird.png",
        "image/musicOff.png",
        "image/musicOn.png",
        "image/auBg.jpg",
        "http://wx.qlogo.cn/mmopen/Q3auHgzwzM4DJfovSJCqebsianIvGcX6HWPFI2bROl3z9B2Bl4iavR5dfIjOqYojfvLNM8uBlkBkZ5G9MhmzcN8j2bQBnkRicEiac449loHwTsE/0",
    
        "image/bbtzw/title.png?v=201509051300",
        "image/bbtzw/startBtn.png?v=201509051300",
        "image/bbtzw/gameBg.jpg?v=201509081300",
        "image/lots1.png",
        "image/lots2.png",
    
        'image/faiImg.png?v=201509171041',
    
    ]);
    loadGamePreAssets();
    hg.assets.loadPage();//开始loading页面
    //全局变量
    var g_config = {
        showSkillSup : true,   //是否开启技术支持
        showSlide : false,     //是否开启底部轮播
        showMenu : true,
        scoreType: false,   //成绩为float或者int类型
        sortType: 0, //成绩排序类型，顺序或者倒序
        countsTimeType: 0, //计时类型，顺序或者倒序
        drawLimitDef : 50,   //游戏默认门槛
        scoreSet : 50,
        style : 22,
        buy : false,
        authVer : 1,
        scoreUnit : '分',
        testCMD : 'null',
        isNewGame : false,
        ajaxUrl : '//hd.faisco.cn/ajax/',
        startTime : '2016-09-22 15:36',
        test : false,
        failSrcId : 31,//srcId
        setGameTimeInterval : 10,           //所有游戏计时时间间隔
        isDoubleGame : false,   //是否是双人游戏
        awardList : [{"level":1,"amount":0,"awardtype":2,"cashtype":2,"attention":1,"cashsite":"请填写您的兑奖地址或者门店地址","pot":0,"style":"一等奖","t_type":"DATE_TYPE_FIX_TIME_RANGE","cbt":1474473600000,"cet":1475164799000,"cft":30,"cfbt":0,"tlmt":"[8]","ocimg":false,"opqrc":true,"optx":false,"oct":false,"oplink":false,"genewxcard":false,"iscuscode":false,"stl":"","opti":"凭券联系现场工作人员兑奖","btn":"了解更多","btl":"","servicepho":"","cashinfo":"","aimg":"image/gift.png?v=201601141500","aimgw":"6rem","aimgh":"6rem","attentionimg":"","onlinect":1,"continfo":0,"name":"价值100元礼品","onlinewxnum":"","pubopl":false},{"level":2,"amount":0,"awardtype":2,"cashtype":2,"attention":1,"cashsite":"请填写您的兑奖地址或者门店地址","pot":0,"style":"二等奖","t_type":"DATE_TYPE_FIX_TIME_RANGE","cbt":1474473600000,"cet":1475164799000,"cft":30,"cfbt":0,"tlmt":"[8]","ocimg":false,"opqrc":true,"optx":false,"oct":false,"oplink":false,"genewxcard":false,"iscuscode":false,"stl":"","opti":"凭券联系现场工作人员兑奖","btn":"了解更多","btl":"","servicepho":"","cashinfo":"","aimg":"image/gift.png?v=201601141500","aimgw":"6rem","aimgh":"6rem","attentionimg":"","onlinect":1,"continfo":0,"name":"价值50元礼品","onlinewxnum":"","pubopl":false},{"level":3,"amount":0,"awardtype":2,"cashtype":2,"attention":1,"cashsite":"请填写您的兑奖地址或者门店地址","pot":0,"style":"三等奖","t_type":"DATE_TYPE_FIX_TIME_RANGE","cbt":1474473600000,"cet":1475164799000,"cft":30,"cfbt":0,"tlmt":"[8]","ocimg":false,"opqrc":true,"optx":false,"oct":false,"oplink":false,"genewxcard":false,"iscuscode":false,"stl":"","opti":"凭券联系现场工作人员兑奖","btn":"了解更多","btl":"","servicepho":"","cashinfo":"","aimg":"image/gift.png?v=201601141500","aimgw":"6rem","aimgh":"6rem","attentionimg":"","onlinect":1,"continfo":0,"name":"价值10元礼品","onlinewxnum":"","pubopl":false},{"level":4,"amount":0,"awardtype":2,"cashtype":2,"attention":1,"cashsite":"请填写您的兑奖地址或者门店地址","pot":0,"style":"四等奖","t_type":"DATE_TYPE_FIX_TIME_RANGE","cbt":1474473600000,"cet":1475164799000,"cft":30,"cfbt":0,"tlmt":"[8]","ocimg":false,"opqrc":true,"optx":false,"oct":false,"oplink":false,"genewxcard":false,"iscuscode":false,"stl":"","opti":"凭券联系现场工作人员兑奖","btn":"了解更多","btl":"","servicepho":"","cashinfo":"","aimg":"image/gift.png?v=201601141500","aimgw":"6rem","aimgh":"6rem","attentionimg":"","onlinect":1,"continfo":0,"name":"价值5元小礼品","onlinewxnum":"","pubopl":false},{"level":5,"amount":0,"awardtype":2,"cashtype":2,"attention":1,"cashsite":"请填写您的兑奖地址或者门店地址","pot":0,"style":"五等奖","t_type":"DATE_TYPE_FIX_TIME_RANGE","cbt":1474473600000,"cet":1475164799000,"cft":30,"cfbt":0,"tlmt":"[8]","ocimg":false,"opqrc":true,"optx":false,"oct":false,"oplink":false,"genewxcard":false,"iscuscode":false,"stl":"","opti":"凭券联系现场工作人员兑奖","btn":"了解更多","btl":"","servicepho":"","cashinfo":"","aimg":"image/gift.png?v=201601141500","aimgw":"6rem","aimgh":"6rem","attentionimg":"","onlinect":1,"continfo":0,"name":"价值5元小礼品","onlinewxnum":"","pubopl":false},{"level":6,"amount":0,"awardtype":2,"cashtype":2,"attention":1,"cashsite":"请填写您的兑奖地址或者门店地址","pot":0,"style":"六等奖","t_type":"DATE_TYPE_FIX_TIME_RANGE","cbt":1474473600000,"cet":1475164799000,"cft":30,"cfbt":0,"tlmt":"[8]","ocimg":false,"opqrc":true,"optx":false,"oct":false,"oplink":false,"genewxcard":false,"iscuscode":false,"stl":"","opti":"凭券联系现场工作人员兑奖","btn":"了解更多","btl":"","servicepho":"","cashinfo":"","aimg":"image/gift.png?v=201601141500","aimgw":"6rem","aimgh":"6rem","attentionimg":"","onlinect":1,"continfo":0,"name":"价值5元小礼品","onlinewxnum":"","pubopl":false},{"level":7,"amount":0,"awardtype":2,"cashtype":2,"attention":1,"cashsite":"请填写您的兑奖地址或者门店地址","pot":0,"style":"七等奖","t_type":"DATE_TYPE_FIX_TIME_RANGE","cbt":1474473600000,"cet":1475164799000,"cft":30,"cfbt":0,"tlmt":"[8]","ocimg":false,"opqrc":true,"optx":false,"oct":false,"oplink":false,"genewxcard":false,"iscuscode":false,"stl":"","opti":"凭券联系现场工作人员兑奖","btn":"了解更多","btl":"","servicepho":"","cashinfo":"","aimg":"image/gift.png?v=201601141500","aimgw":"6rem","aimgh":"6rem","attentionimg":"","onlinect":1,"continfo":0,"name":"价值5元小礼品","onlinewxnum":"","pubopl":false},{"level":8,"amount":0,"awardtype":2,"cashtype":2,"attention":1,"cashsite":"请填写您的兑奖地址或者门店地址","pot":0,"style":"八等奖","t_type":"DATE_TYPE_FIX_TIME_RANGE","cbt":1474473600000,"cet":1475164799000,"cft":30,"cfbt":0,"tlmt":"[8]","ocimg":false,"opqrc":true,"optx":false,"oct":false,"oplink":false,"genewxcard":false,"iscuscode":false,"stl":"","opti":"凭券联系现场工作人员兑奖","btn":"了解更多","btl":"","servicepho":"","cashinfo":"","aimg":"image/gift.png?v=201601141500","aimgw":"6rem","aimgh":"6rem","attentionimg":"","onlinect":1,"continfo":0,"name":"价值5元小礼品","onlinewxnum":"","pubopl":false}],         //奖项列表
        award : null,                       //奖品
        wxAward : null,                       //
        comfort : {"ca":"价值5元小礼品","cas":"安慰奖","cc":20356429,"comAwardtype":2,"comcashtype":2,"conlinect":1,"comcashsite":"请填写您的兑奖地址或者门店地址","ccc":"","cttype":"DATE_TYPE_FIX_TIME_RANGE","comcbt":1474473600000,"comcet":1475164799000,"comft":30,"comfbt":0,"ctlmt":"[8]","comstl":"","comopti":"凭券联系现场工作人员兑奖","comoci":false,"comOpqrc":true,"comoptx":false,"comoct":false,"comOplink":false,"comiscuscode":false,"combtn":"了解更多","combtl":"","comservicephone":"","comcashinfo":"","comimg":"image/gift.png?v=201601141500","comimgw":"6rem","comimgh":"6rem","comattentionimg":"","comcontinfo":0,"comattention":1,"conlinewxnum":""},             //安慰奖
        isRegUserName : false,       //是否登记兑奖姓名
        isRegPhone : false,       //是否登记兑奖联系电话
        isRegAddress : false,       //是否登记兑奖联系地址
        aid : 11203564,
        gameId : 29,
        openId : 'o1ueSjq82FnmM8jph4NlDsOH-CeY',
        awardInfoB : "",
        openAwardLinkNoDraw : false,//非即开型游戏是否开启联系兑奖  
		awardUsername : '',                  //联系兑奖的用户姓名
        awardPhone : '',                  //联系兑奖的联系电话
        status : 2,
        afterWxCard    : true,
        haveAward    : false,
		showHelpGuide :  false,   //是否显示助力引导页面
		playerId :18,
		ipInfo: {"ip":"222.244.99.162","contry":"中国","provice":"湖南省","city":"长沙市","area":"华中","isp":"电信"} , //用户ip信息
        contactNoDraw : "[-1]" //非抽奖派发类型的开启联系兑奖选项信息
    };
    var HdVerDef = {
        FREE : 1,  //免费版
        BY : 2,  //白银版
        BJ : 3,  //铂金版
    };
</script>
<script type="text/javascript" src="js/comm/jquery/jquery-core.min.js?v=201607181759"></script>

<script type="text/javascript" src="js/hdgame.min.js?v=201609211651"></script>
<script type="text/javascript" src="js/hdUtil.min.js?v=201605161742"></script>
<script type="text/javascript" src="js/lufylegend.min.js?v=201609201955"></script>
<script type="text/javascript">
function $$(selector){
    if(!_manage){
        return $('#__notfound__');
    }
    return parent.$(selector);
}
HdGame.gameDomain = 'hd.faisco.cn';
if(false){
    HdGame.gameDomain = 'hd.webportal.cc';
}
HdGame.isReg = false;
/*---------------游戏函数回调--------------------*/
HdGame.initCallBack(hg);
hg.addCallBack(['startGame','startGamehead','home','again','jsFootEnd','hgLoadEnd','save','showResult','changeBottomBar','showPoup','hidePoup','setGameType']);
hg.showGameBox = true; //是否在开始游戏时默认显示游戏页

/*----------------------------可编辑元素包装------------------------------------*/
//通过conf文件配置可编辑元素的属性
if(hg.edit){
    HdGame.initEdit(hg.edit);
}
function parseRemToPx(rem){
    if(rem.indexOf('rem') === -1){
        return parseFloat(rem);
    }
    return parseFloat(rem)*g_rem;
}
/*----------------------------------计时------------------------------------*/
hg.time = null;

(function(hg){
    var initTime = 10;
    if(!g_config.countsTimeType && initTime === 0){
        if(!_manage){
            initTime = 99999;
        }else{
            if(false){
                initTime = 30;
            }else{
                initTime = 10; 
            }
        }
        $(function(){$('.timeBox').hide();});
    }
    hg.time = HdGame.initTime(initTime);
})(hg);

/*----------------------------------计分------------------------------------*/

hg.grade = HdGame.initGrade();

/*----------------------------------声音-----------------------------------*/
hg.sound = null; 
(function(hg){
    var soundList = [{"path":"image/bbtzw/music/bgmusic01M.mp3","fileName":"背景音乐.mp3","optFlag":0},{"path":"image/bbtzw/music/tap.mp3","fileName":"得分音效.mp3","optFlag":2},{"path":"image/bbtzw/music/err.mp3","fileName":"错误音效.mp3","optFlag":2}];
    var soundListDef = [{"path":"*_resRoot*/image/bbtzw/music/bgmusic01M.mp3","fileName":"背景音乐.mp3","optFlag":0},{"path":"*_resRoot*/image/bbtzw/music/tap.mp3","fileName":"得分音效.mp3","optFlag":2},{"path":"*_resRoot*/image/bbtzw/music/err.mp3","fileName":"错误音效.mp3","optFlag":2}];
    var soundListMod = [{"path":"image/bbtzw/music/bgmusic01M.mp3","fileName":"背景音乐.mp3","optFlag":0},{"path":"image/bbtzw/music/tap.mp3","fileName":"得分音效.mp3","optFlag":2},{"path":"image/bbtzw/music/err.mp3","fileName":"错误音效.mp3","optFlag":2}];
    if(soundListMod){
        $.each(soundListMod,function(index,sound) {
            soundListDef[index].path =  sound.path;
            
        });
    }
    soundListMod = null;
    if(soundList){
        $.each(soundList,function(index,sound) {
            var soundDef =  soundListDef[index];
            if(index !== 0 && sound.optFlag === 1){
                sound.optFlag = 2;
            }
            sound.path = HdGame.getSrc(sound.path);
            soundDef.path = HdGame.getSrc(soundDef.path);
        });
    }
    hg.sound = HdGame.initSound(soundList,soundListDef);
    hg.sound.load("image/button.mp3","startButton");
    if(soundList){
        $.each(soundList,function(index,sound) {
            var path = sound.path;
            if(index === 0 ){
                hg.sound.load(path,index,false);
            }else{
                hg.sound.load(path,index);
            }
        });
        if(!_manage){
            hg.sound.cache['0'].data.addEventListener('play',function(){
                $(function(){
                    hg.assets.onReady(function(){
                        $('.soundIcon').removeClass("soundIconOff");
                    });
                });
            },false);
            hg.sound.cache['0'].data.addEventListener('pause',function(){
                $(function(){
                    hg.assets.onReady(function(){
                        $('.soundIcon').addClass("soundIconOff");
                    });
                });
            },false);
        }
        
    }
})(hg);
/*----------------------------------获取ip信息-----------------------------------*/
if(false){
	var countLimit = 5; //限制发送请求次数
	var counter = 0;
	var timer = setInterval(function(){
		if(counter >= countLimit){
			clearInterval(timer);
			return;
		}
		counter++;
		if(!g_config.ipInfo || !g_config.ipInfo.provice){
			$.ajax({
				type : 'post',
				url : '//hd.faisco.cn/ajax/hdgame_h.jsp?cmd=getIPInfo',
				success : function(data){
					var result = $.parseJSON(data);
					if(result.success){
						g_config.ipInfo = result.ipInfo;
					}
					console.log(result.ipInfo);
				}
			});
		}else{
			clearInterval(timer);
			return;
		}
	},1500);
}

</script>

<script type="text/javascript">
    HdGame.wxConfigArg = {
        url : 'https://hd.faisco.cn/11203564/29/load.html?style=22'
    };
    (function(){
        if(false){
            return;
        }
        //判断该玩家是否已获取过礼物
        var arr=['一','二','三','四','五','六','七','八'];
        var haveAward = false;
        if(haveAward){        
            var itemInfo = {"id":18,"aid":11203564,"code":0,"name":"小旋风","awardLevel":0,"achievement":"80","gameId":29,"codeStatus":0,"info":"{\"headImg\":\"http://wx.qlogo.cn/mmopen/Q3auHgzwzM4DJfovSJCqebsianIvGcX6HWPFI2bROl3z9B2Bl4iavR5dfIjOqYojfvLNM8uBlkBkZ5G9MhmzcN8j2bQBnkRicEiac449loHwTsE/0\"}","award":"","openId":"o1ueSjq82FnmM8jph4NlDsOH-CeY","zlid":0,"flag":0,"openIdB":"","drawTotal":0,"codeList":"","jointime":1474529842000};
            if(itemInfo.award.length > 0){
                HdGame.currentAward=itemInfo.award;
            }
            var awardLevel = itemInfo.awardLevel;
            if( awardLevel != 900 && awardLevel > 0 ){  
                if(true && 9 >= awardLevel){
                    var nameList = ["一等奖","二等奖","三等奖","四等奖","五等奖","六等奖","七等奖","八等奖","安慰奖"];          
                    HdGame.currentAwardStyle = nameList[awardLevel-1];
                }else{
                    HdGame.currentAwardStyle = arr[awardLevel-1];
                }
            }else{
                HdGame.currentAwardStyle = 'null';
            }    
        }
        //判断该玩家是否已有过排行榜
        var r = {};
        HdGame.currentRank=r.rank;
        HdGame.currentScore=r.score;
        setWxShareByStatus();
    })();
    
    wx.config({ 
          debug: false,
          appId: 'wx25367438c8ce0799',
          timestamp: 1474879080,
          nonceStr: '54d67b92-67cd-40eb-a404-8e537eccf155',
          signature: '89808170a82fabbf003aee0fc3c9a4da3bed29d2',
          jsApiList: [
            'checkJsApi',
            'onMenuShareTimeline',
            'onMenuShareAppMessage',
            'onMenuShareQQ',
            'onMenuShareWeibo',
            'hideMenuItems',
            'showMenuItems',
            'hideAllNonBaseMenuItem',
            'showAllNonBaseMenuItem',
            'translateVoice',
            'startRecord',
            'stopRecord',
            'onRecordEnd',
            'playVoice',
            'pauseVoice',
            'stopVoice',
            'uploadVoice',
            'downloadVoice',
            'chooseImage',
            'previewImage',
            'uploadImage',
            'downloadImage',
            'getNetworkType',
            'openLocation',
            'getLocation',
            'hideOptionMenu',
            'showOptionMenu',
            'closeWindow',
            'scanQRCode',
            'chooseWXPay',
            'openProductSpecificView',
            'addCard',
            'chooseCard',
            'openCard'
          ]
    });
    
     wx.ready(function(){
        //添加卡券
        
        $('#awardCollectionBtn').on('touchstart',function(){ 
			var isAddCard = true;
            var award = g_config.wxAward;
            var generateWxcard = award.genewxcard;
            if(generateWxcard){
                if(false){
                    HdGame.statusMsg('活动尚未发布','无法加入到微信卡券');
                    return;
                }
                var str = $('#awardDetailBox .codeBgTime').html().replace(/\./g,'/');
                var targetTimeStamp = new Date(str).getTime();
                if(targetTimeStamp > new Date().getTime()){
                    HdGame.statusMsg('未到兑奖时间');
                    return;
                }
                
                var cardId = award.wxcardid;
                var code = $('#awardDetailBox .codeLine .code').text();
                var sysCode = $('#awardDetailBox .codeLine .code').attr('code');
                var depositTime = g_config.award.depositTime;
                HdGame.tlog(cardId);
                HdGame.tlog(code);
                $.ajax({
                    type : 'post',
                    url : '//hd.faisco.cn/ajax/hdgame_h.jsp?cmd=getCardSign&cardTick=&cardId='+cardId+'&code='+code+'&openId=o1ueSjq82FnmM8jph4NlDsOH-CeY',                    
                    error : function(){ 
                        if(m_debug){
                            alert( '服务繁忙，请稍候重试' ); 
                        }   
                    },
                    success : function(data){
                        HdGame.tlog('getCardSign',data);
                        var result = $.parseJSON(data);
                        var cardExt = "{\"timestamp\":\""+result.timestamp+"\",\"openid\":\"o1ueSjq82FnmM8jph4NlDsOH-CeY\",\"nonce_str\":\""+ result.nonce_str +"\",\"code\":\""+ code +"\",\"signature\":\""+result.sign+"\"}";                 
                        if(depositTime && depositTime <　Date.parse(new Date())){
                            isAddCard = false;
                        }   
						HdGame.tlog("depositTime="+depositTime);
                        if(isAddCard){
                            wx.addCard({
                                  cardList: [
                                    {
                                      cardId: cardId,
                                      cardExt: cardExt
                                    }
                                  ],
                                  success: function (res) {
                                        HdGame.tlog('addCard',res);
										HdGame.logDog(1000108 ,1);	//领取微信卡券

                                        //alert('已添加卡券：' + JSON.stringify(res.cardList));
                                        var resItem = res.cardList[0];
                                        isAddCard = false;
                                        $('#awardCollectionBtn').text("打开微信卡券");

                                        if(resItem.isSuccess){
                                            $.ajax({
                                                type : 'get',
                                                url : '//hd.faisco.cn/ajax/hdgame_h.jsp?cmd=setCode&code='+sysCode,                    
                                                error : function(){ 
                                                    if(m_debug){
                                                        alert( '服务繁忙，请稍候重试' ); 
                                                    }   
                                                },
                                                success : function(data){
                                                    HdGame.tlog('setCode',data);
                                                    var result = $.parseJSON(data);
                                                }
                                            }); 
                                        }                       
                                  }
                            });                     
                        }else{  
                            wx.openCard({
                                cardList: [{
                                    cardId: cardId,
                                    code: code
                                }]// 需要打开的卡券列表
                            });     
                        }                       
                    }
                }); 
                
            }   
        });
    });

    wx.ready(function () {
       /* wx.hideMenuItems({
            menuList: ['menuItem:copyUrl'] // 要隐藏的菜单项，只能隐藏“传播类”和“保护类”按钮
        });*/
        
        wx.showAllNonBaseMenuItem();
        try{         
            //是否显示朋友圈分享
            
                
            //微信错误
            wx.error(function(res){
                if(m_debug){
                    alert($.toJSON(res));
                }
            });

        }catch(e){
            alert(e.message);
        }

    });
   
    function decodeHtml(html){
        return html && html.replace ? (html.replace(/&nbsp;/gi, " ").replace(/&lt;/gi, "<").replace(/&gt;/g, ">")
            .replace(/&#92;/gi, "\\").replace(/&#39;/gi, "\'").replace(/&quot;/gi, "\"").replace(/\<br\/\>/gi, "\n").replace(/&amp;/gi, "&")) : html;
    };
    
    function setWxShare(desc,url,callBack){
        if(!_manage){
            desc = desc.replace('红包','');
        }   
        desc = decodeHtml(desc);
        var pyqUrl = url;
        //分享多域名
              
                //是否已经设置过动态分享链接，防止重复设置
                /*if(!arguments.callee.isSetDynRoot){
                    pyqUrl = 'http://www.hdpyqd.com/' + url.replace('http://','').replace('https://','');
                    arguments.callee.isSetDynRoot = true;
                }*/
                pyqUrl = 'http://www.hdpyqd.com/' + url.replace('http://','').replace('https://','') + '&fsl=b';
        
        //分享链接统一加上自己的openid
        url = HdGame.setUrlArg(url,['otherplayer','o1ueSjq82FnmM8jph4NlDsOH-CeY']);
        pyqUrl = HdGame.setUrlArg(pyqUrl,['otherplayer','o1ueSjq82FnmM8jph4NlDsOH-CeY']);

        //如果4个设置项都和上次一样，就直接返回
        if(url === HdGame.wxConfigArg.url && HdGame.wxConfigArg.desc === desc && HdGame.wxConfigArg.callBack === callBack && HdGame.wxConfigArg.pyqUrl === pyqUrl){
            return;
        }

        wx.ready(function () {
            // 1 判断当前版本是否支持指定 JS 接口，支持批量判断
            var wxConfigShareImg = '//hd.faisys.com/image/game/l_bbtzw.jpg?v=201508111845';
            //wxConfigShareImg = 'https://ss0.bdstatic.com/-0U0bnSm1A5BphGlnYG/tam-ogel/99405539aa1591b7461fc73a5a7f1a1f_259_194.jpg';
            if(!/^http:/.test(wxConfigShareImg) && /^\/\//.test(wxConfigShareImg)){
                wxConfigShareImg = 'http:' + wxConfigShareImg;
            }
            try{         
                //分享朋友设置                      
                wx.onMenuShareAppMessage({
                    title: decodeHtml('玩游戏赢大奖'), // 分享标题
                    desc: desc, // 分享描述
                    link: url,  // 分享链接
                    imgUrl: wxConfigShareImg, // 分享图标
                    type: 'link', // 分享类型,music、video或link，不填默认为link
                /*  dataUrl: '',*/ // 如果type是music或video，则要提供数据链接，默认为空
                    success: function () { 
                        $.ajax({
                            type : 'post',
                            url : '//hd.faisco.cn/ajax/hdgame_h.jsp?cmd=setShareNum&aid=11203564&gameId=29&openId=o1ueSjq82FnmM8jph4NlDsOH-CeY',
                            error : function(){ 
                                if(m_debug){
                                    alert( '服务繁忙，请稍候重试' ); 
                                }   
                            },
                            success : function(data){ 
                                if(!m_debug){
                                    //统计分享  
                                    HdGame.logDog(1000004,31);
                                    HdGame.logObjDog(1000092, 2, 29);
                                    HdGame.logDog(1000055,0);
                                }
                                handleShareAward(data);
                                callBack && callBack(data);
                            }
                        }); 
                    },
                    cancel: function () { 
                        // 用户取消分享后执行的回调函数
                        //alert(url);
                    }
                });
                //分享朋友圈设置
                wx.onMenuShareTimeline({
                      title: desc,
                      link: pyqUrl,
                      imgUrl: wxConfigShareImg+"xxxxx",
                      success: function (res) {
                        $.ajax({
                            type : 'post',
                            url : '//hd.faisco.cn/ajax/hdgame_h.jsp?cmd=setShareNum&aid=11203564&gameId=29&openId=o1ueSjq82FnmM8jph4NlDsOH-CeY',
                            error : function(){ 
                                if(m_debug){
                                    alert( '服务繁忙，请稍候重试' ); 
                                }  
                            },
                            success : function(data){
                                if(!m_debug){
                                    //统计分享                                  
                                    HdGame.logDog(1000004,31);
                                    HdGame.logObjDog(1000092, 2, 29);
                                    HdGame.logDog(1000055,1);
                                }
								//alert(wxConfigShareImg);
                                handleShareAward(data);
                                callBack && callBack(data);
                            }
                        });     
                      },
                      cancel: function (res) {
                        //$("#sharePanel").hide();
                      }/*,
                      fail: function (res) {
                        alert(JSON.stringify(res));
                      }*/
                });
                HdGame.tlog('当前分享朋友链接：',url);
                HdGame.tlog('当前分享朋友圈链接：',pyqUrl);
            }catch(e){
                alert(e.message);
            }
        });
        HdGame.wxConfigArg.desc = desc;
        HdGame.wxConfigArg.url = url;
        HdGame.wxConfigArg.callBack = callBack;
        HdGame.wxConfigArg.pyqUrl = pyqUrl;
    }
    function setWxShareUrlArg(){
        var argsArray = Array.prototype.slice.call(arguments);
        argsArray.unshift(HdGame.wxConfigArg.url);
        setWxShare(HdGame.wxConfigArg.desc,HdGame.setUrlArg.apply(HdGame,argsArray),HdGame.wxConfigArg.callBack);
    }
    function removeWxShareUrlArg(){
        var argsArray = Array.prototype.slice.call(arguments);
        argsArray.unshift(HdGame.wxConfigArg.url);
        setWxShare(HdGame.wxConfigArg.desc,HdGame.removeUrlArg.apply(HdGame,argsArray),HdGame.wxConfigArg.callBack);
    }
    function setShareText(text){
        text = text.replace(/\u200b/g,'').replace(/&nbsp;/g,' ').replace(/&lt;/g, '<').replace(/&gt;/g, '>');
        return text.replace(/<span class=["']tag["'] contenteditable=["']?false["']?>(.+?)<\/span>/g,function(match,$1){
            switch($1){
                case '玩家名称':
                    return "小旋风";
                case '游戏成绩':
                    return HdGame.currentScore;
                case '游戏排名':
                    return HdGame.currentRank;
                case '奖品名称':
                    return HdGame.currentAward;
                case '奖项等级':
                    return HdGame.currentAwardStyle;
                case '收集的字':
                    return '"'+HdGame.ccndrmTitle+'"';
            }
        });
    }
    function setWxShareByStatus(url,callBack,noOtherplayer){
        if(false){
            return;
        }
        typeof url === 'undefined' && (url = HdGame.wxConfigArg.url);
        typeof callBack === 'undefined' && (callBack = HdGame.wxConfigArg.callBack);
        if(true){
            if(HdGame.currentAward){
                setWxShare(setShareText('\x3cspan class=\x22tag\x22 contenteditable=\x22false\x22\x3e玩家名称\x3c/span\x3e已经在活动里赢得\x3cspan class=\x22tag\x22 contenteditable=\x22false\x22\x3e奖品名称\x3c/span\x3e，你也快来玩游戏赢大奖吧！'),url,callBack);
            }else if(HdGame.currentRank){
                //url = noOtherplayer ? url : HdGame.setUrlArg(url,['otherplayer','o1ueSjq82FnmM8jph4NlDsOH-CeY']);//在setWxShare中统一加上openid
                setWxShare(setShareText('\x3cspan class=\x22tag\x22 contenteditable=\x22false\x22\x3e玩家名称\x3c/span\x3e以\x3cspan class=\x22tag\x22 contenteditable=\x22false\x22\x3e游戏成绩\x3c/span\x3e的成绩傲视群雄，你敢来挑战Ta赢取丰厚奖品吗？'),url,callBack)
            }else{
                setWxShare(setShareText('轻轻松松就能抽到大奖，积攒多年的人品终于有用了，你也赶紧来抽奖吧！！'),url,callBack);
            }
        }
    }
    function handleShareAward(data){
        var result = $.parseJSON(data);
        HdGame.tlog("shareaward",result.shareaward);
        if(result && result.shareaward){
            drawTimesLimit += 1;
            if(true){
                HdGame.resulePoup.resuleArg.count += 1;
            }
            $(".dayDrawCount").text(drawTimesLimit-count<0 ? 0:(drawTimesLimit-count));
            g_config.showHelpGuide = false;
        }
        $("#helpGuideBox").hide();
    }
</script>
<script type="text/javascript">
    var _gameOver = false;
    var GameArg = {
        createTime : 0.8,
        touchLimit : 1*g_rem,
        first      : true,
        firstTouch : true
    };
    
    var Lolly = (function() {
        var clubImg = null,bSugarImg = null;
        hg.assets.onReady(function(){
            clubImg = new LF.bitmapData(hg.assets[hg.edit.getImgInfo('club').path]);
            bSugarImg = new LF.bitmapData(hg.assets[hg.edit.getImgInfo('bSugar').path]);
        });
        function Lolly(y,flag){
            var s = this;
            LF.base(s,LF.sprite,[true]);
            s.club = new LF.bitmap(clubImg,0.45*g_rem,0,0.1*g_rem,2.625*g_rem);
            flag || (s.club.visible = false);
            s.bSugar = new LF.bitmap(bSugarImg,0,2.625*g_rem,g_rem,g_rem);
            s.addChild(s.club);
            s.addChild(s.bSugar);
            s.x = 7.5*g_rem;
            s.y = y;
            GameArg.stageLayer.addChild(s);
        }
        Lolly.prototype.launch = function(){
            var s = this;
            s.club.visible = true;
            LF.tweenLite.to(s,0.1,{
                y: 13.625*g_rem,
                onComplete : function(){
                    GameArg.sugarY.add(s);
                }
            });
            return s;
        };
        return Lolly;
    })();
    var SugarY = (function(){
        var imgData = null,i = 0;
        hg.assets.onReady(function(){
            imgData = new LF.bitmapData(hg.assets[hg.edit.getImgInfo('ySugar').path]);
        });
        function SugarY() {
            var s = this;
            LF.base(s,LF.sprite,[]);
            s.x = 1.375*g_rem;
            s.y = 4*g_rem;
            s.sugar = new LF.bitmap(imgData,3.625*g_rem,3.625*g_rem,6*g_rem,6*g_rem);
            s.addChild(s.sugar);
            s.rotatex = 6.625*g_rem;
            s.rotatey = 6.625*g_rem;
            GameArg.stageLayer.addChild(s);
        }
        SugarY.prototype.add = function(lolly,rotate){
            var s = this,rotateList = GameArg.rotateList,gradeFlag = false;
            if(typeof rotate === 'undefined'){
                rotate = s.rotate
                gradeFlag = true;
            }
            lolly.y -= s.y;
            lolly.x -= s.x;
            lolly.rotatex = 0.5*g_rem;
            lolly.rotatey = -3*g_rem;
            lolly.rotate = -rotate;
            s.addChild(lolly);
            for(var i = 0;i < rotateList.length;i++){
                if(Math.abs(rotate - rotateList[i]) <= 9){
                    hg.sound.play(2);
                    endGame(lolly);
                    hg.time.end();
                    return s;
                }
            }
            if(gradeFlag){
                hg.grade(10);
                hg.sound.play(1);
            }
            rotateList.push(rotate);
            return s;
        };
        SugarY.prototype.rotating = function(){
            var s = this;
            LF.tweenLite.to(s,7,{
                loop : true,
                rotate : 360,
                onComplete : function(){
                    s.rotate = 0;
                }
            });
            return s;
        };
        return SugarY;
    })();
    function initCanvas(){
        LF.global.notMouseEvent = true;
        LF.init(0,"gameLayerBox",0,0,initGame,LF.event.INIT);
    }
    function canvasDown(e){
        if(_gameOver){
            return;
        }
        GameArg.lastPageY = e.changedTouches[0].pageY;
    }
    function canvasMove(e){
        if(_gameOver){
            return;
        }
        if(GameArg.lastPageY && GameArg.lastPageY - e.changedTouches[0].pageY > g_rem){
            if(!HdGame.isplaySucess){
                GameArg.first = false;
                HdGame.isplaySucess = true;
                GameArg.mask.removeAllChild();
                GameArg.mask.remove();
                GameArg.mask.die();
                delete GameArg.mask;
            }
            if(GameArg.firstTouch){
                GameArg.firstTouch = false;
                GameArg.sugarY.rotating();
                hg.time.start();
            }
            addReadyList();
            GameArg.lastPageY = null;
        }
    }
    function addReadyList(){
        var readyList = GameArg.readyList;
        GameArg.lollyList.push(readyList.pop().launch());
        readyList.splice(0,0,new Lolly(LF.global.height + 4.125*g_rem));
        $.each(readyList,function(index,sugarB) {
            LF.tweenLite.to(sugarB,0.2,{
                y : LF.global.height - 2.625*g_rem - index*1.5*g_rem
            })
        });
    }
    function creatSugarY(){
        var sugarY = new SugarY();
        for(var i = 0;i < 4;i++){
            sugarY.add(new Lolly(13.625*g_rem,true),GetRandomNum(i*90 + 16,(i + 1)*90 - 6));
        }
        GameArg.sugarY = sugarY;
    }
    function showTishi(){
        var tishiImg = hg.assets["image/bbtzw/tishi.png"],
            jtBitmap = new LF.bitmap(new LF.bitmapData(tishiImg,20,12,90,300),6.875*g_rem,LF.global.height - 7.5*g_rem,2.25*g_rem,7.5*g_rem),
            handBitmap = new LF.bitmap(new LF.bitmapData(tishiImg,220,30,84,95),7.7*g_rem,LF.global.height,2.1*g_rem,2.375*g_rem);
        GameArg.mask = new LF.sprite(true);
        var maskObj = new LF.bitmap(new LF.bitmapData("#000000",0,0,LF.global.width,LF.global.height));
        maskObj.alpha = 0.6;
        GameArg.mask.addChild(maskObj);
        GameArg.mask.addChild(jtBitmap);
        GameArg.mask.addChild(handBitmap);
        LF.tweenLite.to(handBitmap,1,{
            loop : true,
            y : LF.global.height - 7.5*g_rem,
        }).to(handBitmap,0.2,{
            loop : true,
            alpha : 0,
            onComplete : function(){
                handBitmap.alpha = 1;
                handBitmap.y = LF.global.height;
            }
        });
    }
    function initGame(){
        GameArg.left = parseInt(0.5*g_rem);
        GameArg.top = parseInt(4*g_rem);
        LF.global.canvasObj.addEventListener('touchstart',canvasDown,false);
        LF.global.canvasObj.addEventListener('touchmove',canvasMove,false);
        GameArg.stageLayer = new LF.sprite(true);
        startGame();
    }
    function endGame(lolly){
        _gameOver = true;
        LF.tweenLite.removeAll();
        if(lolly){
            LF.tweenLite.to(lolly,0.1,{alpha:0})
                .to(lolly,0.1,{alpha:1})
                .to(lolly,0.1,{alpha:0})
                .to(lolly,0.1,{alpha:1})
                .to(lolly,0.1,{alpha:0})
                .to(lolly,0.1,{alpha:1})
                .to(lolly,0.1,{alpha:0})
                .to(lolly,0.1,{alpha:1,
                    onComplete : function(){
                        LF.global.setPauseLoop(true);;
                        gameOver(hg.grade.val);
                    }
                });
        }else{
            LF.global.setPauseLoop(true);;
            gameOver(hg.grade.val);
        }
    }
    function startGame(){
        _gameOver = false;
        LF.global.setPauseLoop(false);;
        window.scrollTo(0,0);
        GameArg.stageLayer.removeAllChild();
        GameArg.readyList = [];
        GameArg.lollyList = [];
        GameArg.rotateList = [];
        GameArg.firstTouch = true;
        creatSugarY();
        for(var i = 0;i < 5;i++){
            GameArg.readyList.push(new Lolly(LF.global.height - 2.625*g_rem - i*1.5*g_rem))
        }
        if(!HdGame.isplaySucess){
            showTishi();
        }
    }
    function GetRandomNum(a,b){
        return a+Math.round(Math.random()*(b-a));
    }
    function GetRandom(a,b){
        return a+Math.random()*(b-a);
    }
    
    $(function(){          
        gameInit();
        if(_manage){        
            $('#gameLayerBox').css({
                'height'      : '13.25rem',
                'min-height'  : '13.25rem',
                'top'         : '4rem',
                'left'        : '1.375rem',
                'width'       : '13.25rem'
            });
        }else{
            hg.on('startGame',function(){
                if(GameArg.first){
                    initCanvas();
                }else{
                    startGame();
                }
            });
            hg.time.on('end',endGame);
        }
        $('.gameBox').on('touchmove',function(event){
            event.preventDefault();
            event.stopPropagation();
        });
    }); 
    function gameInit() {
        hg.time.init();
        hg.grade.set(0);
        $('.timeUpImg').hide();
    }
    function home(){
        $('#ruleImg').show();
        $('.homeBtnBox').show();
        $('.footerBox').show();
        $('.gameBox').hide();
        startBtnDelay();
        $('.home').show();
        $('#poupInfoBox').hide();
        $('.resuleBox').hide();
        gameInit();
        hg.fire('home');
    }
    function gameRestart() {
        $('.gameBox').show();
        gameInit();
        if(!_manage){
            startGame();
        }
        hg.fire('again');
    }
    function showGamePage(){
        $('#ruleImg').hide();
        $('.homeBtnBox').hide();
        $('.footerBox').hide(); 
        $('.home').hide();
        $('#poupInfoBox').hide();
        $('.resuleBox').hide();
        $('.gameBox').show();
    }
</script> 

<script type="text/javascript">
    var drawTimesLimit = 3;
    var drawTotalLimit = 6;
    var totalCount = 0;
    var isLimitDraw = false;
    var otherPlayerInfo = {};
    var showAwardList = false;
    var informNum = 0;
    var playerAwardList = [];
    var count = 0;
    var skillSupportType = 2;
    var skillName = HdGame.decodeHtml('凡科互动');
    var skillLink = HdGame.decodeUrl(HdGame.decodeHtml('http%3A%2F%2Fmp.weixin.qq.com%2Fs%3F__biz%3DMjM5MTk5MjI3OA%3D%3D%26mid%3D209854000%26idx%3D1%26sn%3D82241d924839270d3ea820ad2d56c01b%23wechat_redirect'));
	var gameType = 0;
    var userInfo = {
        headImg:'http://wx.qlogo.cn/mmopen/Q3auHgzwzM4DJfovSJCqebsianIvGcX6HWPFI2bROl3z9B2Bl4iavR5dfIjOqYojfvLNM8uBlkBkZ5G9MhmzcN8j2bQBnkRicEiac449loHwTsE/0',
        userName: "小旋风",
        showStyle : 1
    }
    var isPublish = false;
    var rankShowNum = 100;
    if(true){
        isPublish = true;
    }
	initChangePoup();
    //初始化弹出层参数
	function initChangePoup(){
		HdGame.initChangePoup({
			rankUrl        : '//hd.faisco.cn/ajax/hdgame_h.jsp?cmd=getRankList&aid=11203564&gameId=29&style=22&openId=o1ueSjq82FnmM8jph4NlDsOH-CeY',
			awardUrl       : '//hd.faisco.cn/ajax/hdgame_h.jsp?cmd=getGiftList&aid=11203564&style=22',
			getRegAwardUrl : '//hd.faisco.cn/ajax/hdgame_h.jsp?cmd=getRegAwardList&aid=11203564&gameId=29&style=22&openId=o1ueSjq82FnmM8jph4NlDsOH-CeY',
			openId         : 'o1ueSjq82FnmM8jph4NlDsOH-CeY',
			gameId         : 29,
			mhaveScore     : (true && gameType != 3),
			informUrl      : '//hd.faisco.cn/ajax/hdgame_h.jsp?cmd=setInformNum&aid=11203564&gameId=29&openId=o1ueSjq82FnmM8jph4NlDsOH-CeY',
			hasReport      : false,
			afterWxCard    : true
		});
	}
    HdGame.resulePoup.init({
        drawType  : 1,
        checkRegUrl:'//hd.faisco.cn/ajax/hdgame_h.jsp?cmd=checkRegNum&aid=11203564&gameId=29&openId=o1ueSjq82FnmM8jph4NlDsOH-CeY',  
        regUrl    : '//hd.faisco.cn/ajax/hdgame_h.jsp?cmd=setPlayerReg&aid=11203564&gameId=29&openId=o1ueSjq82FnmM8jph4NlDsOH-CeY&flag1=true',
        home      : typeof home !== 'undefined' ? home : null,
        again     : typeof gameRestart !== 'undefined' ? gameRestart : null,
        giftInit  : luckDraw
    });
    $(function(){
        //根据setting初始化页面设置
        
            HdGame.unPublishMsg();        
            if(true){ //奇葩BUG，魅蓝note如果不加未发布条玩游戏会一直抖，
                $('.unPublish').css('top',-2 + 'rem');     //目前找不到原因，只能发布之后也出现未发布条，
            }                                            //然后将top设为负数使其隐藏
        
        var hostName = HdGame.decodeHtml('zhanglang108');
        var hostLink = HdGame.decodeHtml('http://').replace('http://',''); //统一去掉，在地址栏统一拼接
        var menuLink = HdGame.decodeHtml('').replace('http://','');
        var menuName = $('.menuName');
        if(false){
            $("#resulte-gift-showMyAward").data("openCode",'null');
            showAwardDetail4Draw();
        }
        $('#showRankNum').text(rankShowNum);
        $('.hostName').text(hostName);

        $('#phoneInput,#nameInput,#addressInput').click(function(){
            $('#spxdPage').addClass('spxdPageHide');
        });
        $('#userSubmitBtn').on('touchstart',function(){
            if(!$(this).hasClass('submit')){
                return;
            }
			var name = $.trim( $('#nameInput').val() );
            var phone = $('#phoneInput').val().replace(/\s/g,"");
            //var phone = $('#phoneInput').val();
            var address = $.trim( $('#addressInput').val() );

            if( $('#nameInput').is(":visible")){
                if(name.length == 0){
                    HdGame.showMsgToast("请输入姓名",2000,'msg-toastBig');
                    return;
                }
                if(HdGame.checkCharacterLen(10,$('#nameInput'))){
                    HdGame.showMsgToast("姓名不能超过5个中文或10个英文字母",2000,'msg-toastBig');
                    return;
                }
                g_config.isRegUserName = true;
            }
            if( $('#phoneInput').is(":visible")){
                var reg = /^[0-9]*$/;
                if(phone.length == 0){
                    HdGame.showMsgToast("请输入联系电话",2000,'msg-toastBig');
                    return;
                }
                if(phone.length > 11 || !reg.test(phone)){
                    HdGame.showMsgToast("请输入正确的号码",2000,'msg-toastBig');
                    return;
                }
                g_config.isRegPhone = true;
            }
            if( $('#addressInput').is(":visible")){
                if(address.length == 0){
                    HdGame.showMsgToast("请输入联系地址",2000,'msg-toastBig');
                    return;
                }
                if(HdGame.checkCharacterLen(200,$('#addressInput'))){
                    HdGame.showMsgToast("联系地址不能超过100个中文或200个英文字母",2000,'msg-toastBig');
                    return;
                }
                g_config.isRegAddress = true;
            }
            
            name = name ? name : '';
            phone = phone ? phone : '';
            address = address ? address : '';
			g_config.awardUsername = name;
			g_config.awardPhone = phone;
            g_config.awardAddress = address;
			//排名型游戏因为设置成绩前db里还没有玩家纪录，故把联系信息在提交成绩时一起设
			if(gameType == 3){				
				HdGame.aUserInfo.hide();
				return;
			}
			$('.ajaxLoadBg').show();
			$('.ajaxLoadBar').addClass('ajaxLoad');
			$.ajax({
				type : 'post',
				url : '//hd.faisco.cn/ajax/hdgame_h.jsp?cmd=setPhone&aid=11203564&gameId=29&openId=o1ueSjq82FnmM8jph4NlDsOH-CeY&phone='+phone+'&ausername='+name+'&address='+address,
				error : function(){ 
					HdGame.otherAjaxComplete();
					$('#spxdPage').removeClass('spxdPageHide');
				},
				success : function(data){   
					$('#spxdPage').removeClass('spxdPageHide');
					var result = $.parseJSON(data);
					HdGame.otherAjaxComplete();
					$('#awardUserInfoBg').hide();
					if(result.success){
                        if(true){
                            HdGame.aUserInfo.hide();
                        }												
					}                              
				}
			});    
        });
        $('#userCancelBtn').on('touchstart',function(){
            event.preventDefault();
            event.stopPropagation();
            $('#awardUserInfoBg').hide();
            $('#spxdPage').removeClass('spxdPageHide');
			$('.safetyBg').hide();
			if(gameType == 3){				
				home();
			}
        });
		$('.resule-status-send').on('touchstart',function(){
			if(_manage){
				return;
			}   
			if(g_config.haveAward){//已经中奖
				HdGame.changePoup(3);
			}else{
				luckDraw();
			}	
		});
		$('#helpGuideBox').on('touchend',function(){
			$('#helpGuideBox').hide();
		});
        //礼品弹出层初始化
        $('#awardInfo').on('click','.codeInfoBox',HdGame.openAwardDetail);
        $('#resulte-gift-showMyAward').on('touchstart',showAwardDetail4Draw);
        $('.awardCloseIcon').on('touchstart',function(){
            removeWxShareUrlArg('fromFav');
            $('#awardDetailBox').hide();
            $('#resule-gift-box,resule-status-box').hide();
            $('.gameBox').add('.home').removeClass('overflow-y-hidden');
            true && $('.bottomSkill').show();
        });
        $('.codeImg').on('click',function(){
            $('.codeDetailImgBox').show();
        });
        $('.codeDetailImgBox').click(function(){
            $(this).hide();
        });
        
        $('.awardCusText').on('touchstart',function(){
            if(true){
                $('#ticketDetailBox').show();
            }else{
                var awardCusTextInfo = $('#awardCusTextInfo');
                if(awardCusTextInfo.css('display') == 'block'){
                    $(this).find('.awardDeailIcon').removeClass('awardIncoSlideDown');
                    $(this).find('.awardDeailIcon').addClass('awardIncoSlideUp');               
                }else{
                    $(this).find('.awardDeailIcon').removeClass('awardIncoSlideUp');
                    $(this).find('.awardDeailIcon').addClass('awardIncoSlideDown');
                }           
                awardCusTextInfo.slideToggle();
            }
        });

        $('.ticketitle .closeBtn').on('touchstart',function(){
            $('#ticketDetailBox').hide();
        })

        
        if(true){
            $('.resule-fxts').hide();
        }
        true && g_config.showSkillSup && HdGame.logDog(1000028,0);
        if(false && g_config.showSkillSup){
            HdGame.logDog(1000062,2);
        }else if(false && g_config.showSkillSup){
            HdGame.logDog(1000067,2);
        }
        if(false){
            $('.home,.showBottomSkillPage').append('<div class="bottomSkill skillInfo">本游戏由 <span class="yySkill" style="text-decoration:underline;">凡科互动</span> 提供</div>');
            $('.yySkill').click(function(){
				
                $('#yyAttentionMask').show();
            });
        }else{
            if(false){
                $('.home,.showBottomSkillPage').append('<div class="bottomSkill skillInfo">游戏技术由 <a href="http://mp.weixin.qq.com/s?__biz=MjM5MTk5MjI3OA==&mid=209854000&idx=1&sn=82241d924839270d3ea820ad2d56c01b#rd">凡科互动</a> 提供</div>');
            }else if(true){
                $('.home,.showBottomSkillPage').append('<div class="bottomSkill skillInfo">游戏技术由 凡科互动 提供</div>');
            }
        }
    
        _manage && $('a').on('click',function(){ return false; });

        $('.homePoupMask').on('touchend',function(event){
            event.preventDefault();
            event.stopPropagation();
            if(_manage){
                return;
            }
            if($(event.target).hasClass('homePoupMask')){
                $(this).hide();
            }
        });
       
        $('.menuBtnBox').on('touchend',function(){
            HdGame.logDog(1000012);
        });
        if(true){
            $('#joinNumLine').show();
        }else{
            $('#joinNumLine').hide();
        }
        if(false){
            $('#Award_Round_Dot').css('display','inline-block');
        }
        if(false){
            $('#Mingdan_Round_Dot').css('display','inline-block');
        }
		if(false){
            $('#myAwardBtn').show();
        }
        if(false){            
            $('#selfAwardLine').show();
            $('#awardLineBox').hide();
        }else{
            $('#awardLineBox').show();
            $('#selfAwardLine').hide();
        }
        if(!true){
            $('.skillInfo').hide();
        }
        if(false){
            $('.menuBtnBox').hide();
        }else if(false){
            if($.trim(menuLink).length == 0){
                menuName.css('text-decoration','none');
                //menuName.attr('href','#');
            }else{
                menuName.attr('href',HdGame.decodeHtml(''));
            }
        }else if(true){
            (function(){
                var attentionMask = $('#attentionMask');
                if(HdGame.decodeHtml('') === ''){
                    $('#QRImg').remove();
                }
                $('.menuBtnBox').on('touchend',function(){
                    attentionMask.show();
                });
            })();
        }
        if($.trim(hostLink).length == 0){
            $('.hostName').css('text-decoration','none');
            $('a.hostName').attr('href','#');
        }
        //总抽奖次数显示逻辑
        if(true){
            $('.totalDraw').hide();
        }else{
            $('.totalDraw').show();
            $('.dayDraw').hide(); 
            if(true){
                $('.dayDraw4Total').show();
            }
        }
        if($('#awardExplain').text().length == 0){
            $('#awardExplain_h').hide();
        }
        $('a.hostName').click(function(){
            HdGame.logDog(1000013);
        });
        if(skillSupportType == 1){
            $('.skillLine').css('padding','0');
            $('.skillCont').hide();
        }else if(skillSupportType == 3){
            $('.skillName').text(skillName);
            $('.skillName').attr('href',skillLink);
        }
        if(skillSupportType != 3 || skillLink.indexOf('mp.weixin.qq.com/s?__biz=MjM5MTk5MjI3OA==&mid=209854000&idx=1&sn=82241d924839270d3ea820ad2d56c01b#wechat_redirect') >= 0 ){
            $('.skillName').click(function(){
                if(_manage) return;
                HdGame.logDog(1000013);
                if(true){
                    HdGame.logDog(1000070,1);
                }else if(false){
                    HdGame.logDog(1000070,3);
                }else if(false){
                    HdGame.logDog(1000070,5);
                }
                $('#skillSupMask').show();
                return false;
            });
        }
        $('.skillInfo a').click(function(){
            if(_manage){
                return;
            }
            HdGame.logDog(1000005,0);
            if(true){
                HdGame.logDog(1000070,0);
            }else if(false){
                HdGame.logDog(1000070,2);
            }else if(false){
                HdGame.logDog(1000070,4);
            }
            if(false){
				
                $('#yyAttentionMask').show();
                return false;
            }else if(true){
                $('#skillSupMask').show();
                return false;
            }
        });

        //音乐图标插入游戏位置
        
            $('.home').add('.gameBgBox').append('<div class="soundIconOff soundIcon" style="z-index:90"></div>');
            $('.home .soundIcon:not(".soundIconPlay")').css({
                "left":'0.75rem',
                "top":'1rem'
            });
            
               $('.home .soundIcon').hide();
            
        

        
    
        (function(){
            $('.gameBgBox .soundIcon').css('z-index','100');
            $('.soundIcon').addClass('soundIconPlay');
            //音乐图标点击事件
            var soundPauseCord = 'soundPause|11203564|29|o1ueSjq82FnmM8jph4NlDsOH-CeY';
            $('.soundIcon').on('touchstart',function(){
                var self = $('.soundIcon');
                if(!self.hasClass('soundIconOff')){
                    //关闭音乐
                    hg.sound.allowPlay = false;
                    hg.sound.pauseAll();
                    HdGame.setLocalStorage(soundPauseCord,'-');
                }else{
                    hg.sound.allowPlay = true;
                    hg.sound.readyPlay(0,0,'loop');
                    HdGame.setLocalStorage(soundPauseCord,'');
                }
            });
            if(HdGame.getLocalStorage(soundPauseCord)){
                hg.sound.allowPlay = false;
                hg.sound.pauseAll();
            }
            $('#ruleImg').addClass('ruleImgAnimate');
            $('#startBtnImg,.startBtnImg').on('touchend',function(event){
				//限制参与地区
				if( checkAreaLimit() != 'ok' ){ //不在限制的地区内，直接返回
					return;
				}
				/*if(false){ //有开启参与地区限制
					var areaLimit_province = '-1'.split(':');
					var areaLimit_city = '-1'.split(':');
					var now_province = g_config.ipInfo.provice;
					var now_city = g_config.ipInfo.city;
					//console.log(g_config.ipInfo);
					if(areaLimit_province[0] != "-1"){ //限制为全部地区的不用判断ip信息，否则判断用户是否在限制地区内
						if( now_province && now_city ){ //有查到当前ip信息
							if( areaLimit_city[0] == "-1" ){ //不限制城市，只限制省份
								if( areaLimit_province[0] != "-1" && now_province.indexOf(areaLimit_province[1]) == -1 ){ //用户不在限制的省份内
									HdGame.statusMsg("该活动限制地区",'该活动仅限'+areaLimit_province[1]+'地区的用户参与');
									return;
								}
							}else{ //限制城市
								if( now_city.indexOf(areaLimit_city[1]) == -1 ){ //用户不在限制的城市内
									HdGame.statusMsg("该活动限制地区",'该活动仅限'+areaLimit_city[1]+'地区的用户参与');
									return;
								}
							}
						}else{ //没有查到当前ip信息，显示服务繁忙
							HdGame.statusMsg("服务繁忙，请稍候重试",'');
							return;
						}
					}
				}*/
				
                if(false){
                    HdGame.statusMsg('你有疑似作弊行为，已被列入黑名单','');
                    return;
                }
                hg.sound.play("startButton");
                if(typeof hg.sound.cache[0] !== 'undefined' && typeof hg.sound.cache[0].playing !== 'undefined' && !hg.sound.cache[0].playing){
                    hg.sound.readyPlay(0,0,'loop');
                }
                startBtnAjax.call(this,event);
            }); 
        })();
    
    });

    //标题与开始按钮动画
    function startBtnDelay(){
        $('.titleImg').removeClass('titleDown').addClass('titleDown');
        $('#startBtnImg').removeClass('startTada');
        
	    	hg.sound.pauseAll();
    	
        setTimeout(function(){
            $('#startBtnImg').addClass('startTada');
        },1000);
		//HdGame.tlog("nowIPInfo",{"ip":"222.244.99.162","contry":"中国","provice":"湖南省","city":"长沙市","area":"华中","isp":"电信"});
    }
    $(function(){
        if(_manage){        
            startBtnDelay();
        }else{
            hg.assets.onload(startBtnDelay);
        }
    })

    /*----------------PK环节--------------------*/
    function createPK(){
        $(".one").hide().siblings().show();
        $("#resule-status-box").show();
        $("#resule-status-head p").show();
        $(".resuleBox").show();
        $(".resule-bgLight").hide();
        $("#resule-status-ribbon").hide();
        $(".little-PK").show().siblings().hide();
        $(".resule-status-again").hide();
        $(".resule-status-home").hide();
        $(".resule-status-rightNow").show().siblings().hide();
        $(".resule-status-firstPage").show();
    }

    function finishPK(){
        $("#resule-status-box").hide();
        $("#resule-status-head p").hide();
        $(".resuleBox").hide();
        $(".resule-bgLight").show();
        $("#resule-status-ribbon").show();
        $(".little-PK").hide().siblings().show();
        $(".resule-status-again").show();
        $(".resule-status-home").show();
        $(".resule-status-rightNow").hide().siblings().show();
        $(".one").show().siblings().hide();
        $("#resule-status-ribbon").show();
        $(".resule-status-firstPage").hide();
    }
    $(function(){
        $(".one").show();
        $(".resule-status-firstPage").hide();

        if(true && !_manage && otherPlayerInfo && typeof otherPlayerInfo.headImg !== "undefined" && typeof otherPlayerInfo.name !== "undefined" && typeof otherPlayerInfo.score !== "undefined" && typeof otherPlayerInfo.rank !== "undefined" && typeof otherPlayerInfo.award !== "undefined"){

            var crrPkrecord = 'PKrecord|' + otherPlayerInfo.aid + '|' + otherPlayerInfo.gameId + '|' + otherPlayerInfo.openId;
            if(!HdGame.getLocalStorage(crrPkrecord)){
                if(otherPlayerInfo.award != ""){
                    $(".WhetherAward").text("获得"+otherPlayerInfo.award).show();
                }
                $(".PKner-A img").attr("src",otherPlayerInfo.headImg);
                $(".userA-name").text(otherPlayerInfo.name);
                $(".fighter-B").text(otherPlayerInfo.name);
                $(".othergrade .resuleArg").text(otherPlayerInfo.score);
                $("#rankB .resuleArg").text(otherPlayerInfo.rank);
                createPK();
                //每次进入PK页面都会设置cookie
                HdGame.setLocalStorage(crrPkrecord,'-');
            }
        }
        $(".winAWard a").on("touchend",function(){
            showRule();
        });
        $(".resule-status-rightNow").on("touchend",function(){
            hg.on('startGame',function(){
                finishPK();
                hg.off('startGame',arguments.callee);
            });
            $("#startBtnImg").trigger("touchstart");
            $("#startBtnImg").trigger("touchend");
        });
        $(".resule-status-firstPage").on("touchend",function(){
            finishPK();
        });
    });

    //礼品轮播
    function setStartBtnHeight(flag1,flag2){
        var windowH = $(window).height();
        if(windowH === 0){
            console.log('window高度为零！');
            setTimeout(function(){
                setStartBtnHeight(flag1,flag2);
            },20);
            return;
        }
        typeof flag1 === 'undefined' && (flag1 = false);
        typeof flag2 === 'undefined' && (flag2 = true);
        var slideStatus = flag1?1:0;
        var skillStatus = flag2?1:0;
        var bottomFixed = $('.bottomSkill').outerHeight()*skillStatus + $('.showAwardBox').outerHeight()*slideStatus;
        var startBtnImg = $('#startBtnImg').parent();
        var ruleImg = $('#ruleImg');
        var joinNumLine = $('#joinNumLine');
        var drawInfo = $('#drawInfo');
        var homeBtnBox = $('.homeBtnBox');
		var gameTips = $('#gameTips'); //铁人三项玩法提示

        var eleTop = parseInt(startBtnImg.css('top')) + startBtnImg.outerHeight();
        var eleTop1 = parseInt(joinNumLine.css('top')) + joinNumLine.outerHeight();
        var eleTop2 = parseInt(drawInfo.css('top')) + drawInfo.outerHeight();
        var eleTop3 = parseInt(ruleImg.css('top')) + ruleImg.outerHeight();
		var eleTop4 = parseInt(gameTips.css('top')) + gameTips.outerHeight();

        if(startBtnImg.length > 0 && eleTop > windowH - bottomFixed){
            startBtnImg.css('top',(windowH - bottomFixed - startBtnImg.outerHeight() - 5)/g_rem + 'rem');
        }
        if(ruleImg.length > 0 && eleTop3 > windowH - bottomFixed){
            ruleImg.css('top',(windowH - bottomFixed - ruleImg.outerHeight() - 5)/g_rem + 'rem');
        }
        if(joinNumLine.length > 0 && eleTop1 > windowH - bottomFixed){
            joinNumLine.css('top',(windowH - bottomFixed - joinNumLine.outerHeight() - 5)/g_rem + 'rem');
        }
        if(drawInfo.length > 0 && eleTop2 > windowH - bottomFixed){
            drawInfo.css('top',(windowH - bottomFixed - drawInfo.outerHeight() - 5)/g_rem + 'rem');
        } 
        if(homeBtnBox.length > 0){
            homeBtnBox.css('bottom', (bottomFixed + 8)/g_rem + 'rem');
        }
		if(gameTips.length > 0 && eleTop4 > windowH - bottomFixed){
            gameTips.css('top',(windowH - bottomFixed - gameTips.outerHeight() - 5)/g_rem + 'rem');
        }
        $('#limitRange').css('height',($(window).height()-bottomFixed)/g_rem + 'rem');
    }
	$(function(){
        function sortBy(name){ //给数组里的对象按某个key的值排序
            return function(o, p){
                var firstItem, secondItem;
                if (typeof o === "object" && typeof p === "object" && o && p){
                    firstItem = o[name];
                    secondItem = p[name];
                    if (firstItem === secondItem) {return 0;}
                    if (typeof firstItem === typeof secondItem) { return firstItem < secondItem ? -1 : 1;}
                    return typeof firstItem < typeof secondItem ? -1 : 1;
                }
            }
        }
        if(_manage){
             $('.home,.showAwardBoxPage').append('<div class="showAwardBox"><ul class="awardInfoList"><li>'+
                '<div><img src="http://wx.qlogo.cn/mmopen/Q3auHgzwzM4DJfovSJCqebsianIvGcX6HWPFI2bROl3z9B2Bl4iavR5dfIjOqYojfvLNM8uBlkBkZ5G9MhmzcN8j2bQBnkRicEiac449loHwTsE/0"><span class="winner">范女神<span>获得了<span class="award">100元优惠券</span></div>'+
                '<div><img src=""><span class="winner">小星儿<span>获得了<span class="award">50元优惠券</span></div>'+
                '<div><img src=""><span class="winner">LVYD<span>获得了<span class="award">30元优惠券</span></div>'+
                '<div><img src=""><span class="winner">萌妹子<span>获得了<span class="award">10元优惠券</span></div>'+
                '</li></ul></div>');

            $('#skillLine').css('min-height','1rem');
        }else if(!_manage && playerAwardList.length > 3){
            playerAwardList.sort(sortBy("awardLevel"));
            $('.home,.showAwardBoxPage').append('<div class="showAwardBox"><ul class="awardInfoList"><li></li></ul></div>');
            var awardList = '';
            $.each(playerAwardList,function(index,value){
                awardList += '<div><img src="'+ JSON.parse(this.info).headImg +'"><span class="winner">'+this.name+'<span>获得了<span class="award">'+this.award+'</span></div>';
            });
            $('.awardInfoList li').append(awardList);
        }
        if(!_manage){
            $('.showAwardBox').awardSlide({'margin_right':'0.8rem','speed': 15 }); 
            if(1 == 0){
                if(false){
                    var bottomSkill = $('.bottomSkill');
                    var flag = $(window).height()/$(window).width() < 1.575;
                    var bgHeight = flag ? $(window).width()*1.575 : $(window).height();
                    $('.home').html('');
                    $('.home').append(bottomSkill);
                    $('.home').append('<p style="font-size:0.9rem; color:#e7e7e7; text-align: center; padding-top:10rem; line-height: 1.3rem">活动已结束<br>请期待下次活动</p>');
                    $('.home').css({'height':bgHeight,'background':'#424242','width':'100%'});
                    document.title = '活动已结束';
                    $('.gameInfoBox').hide();
                     $('.showAwardBox').hide();
                    hg.sound.allowPlay = false;
                    hg.sound.pauseAll();
                }
            }
        }
        setTimeout(function(){
            var flag = $(window).height()/$(window).width() < 1.575;
            var bgHeight = flag ? $(window).width()*1.575 : $(window).height();
            var skillStatu = true?1:0;
            if(_manage){
                $('.showAwardBox').css("top",(bgHeight - $('.bottomSkill').outerHeight()*skillStatu-$('.showAwardBox').outerHeight()-2)/g_rem + 'rem');
            }else{
                $('.showAwardBox').css("top",(bgHeight - $('.bottomSkill').outerHeight()*skillStatu-$('.showAwardBox').outerHeight())/g_rem + 'rem');
            }
            if(true){
                $('.showAwardBox').css("top",(bgHeight - $('.bottomSkill').outerHeight()*skillStatu-$('.showAwardBox').outerHeight()-2)/g_rem + 'rem');
            }
        },50);
        if(!false){
            $('.showAwardBox').hide();
        }else if(!_manage){
            $('.showAwardBox').addClass('footerBox');
        }
	});

    //公共函数
	/*
	$('#jv_share_btn').click(function(){
		$.ajax({
			type : 'post',
			url : '//hd.faisco.cn/ajax/hdgame_h.jsp?cmd=setShareNum&aid=11203564&gameId=29&openId=o1ueSjq82FnmM8jph4NlDsOH-CeY',
			error : function(){ 
				if(m_debug){
					alert( '服务繁忙，请稍候重试' ); 
				}  
			},
			success : function(data){
				if(!m_debug){
					//统计分享                                  
					HdGame.logDog(1000004,31);
					HdGame.logDog(1000055,1);
				}
			}
		});
	});
	*/
    
    //抽奖结果页或收藏卡劵的显示兑奖详细页
    function showAwardDetail4Draw(){
        home();  
        HdGame.changePoup(3);
    }
    function setAwardImgHeight(){
        $('#resule-gift-foot').css("margin-top",($('#resule-gift-sucImg').height()+35)/g_rem + 'rem');
    }

	function showRank(){
		HdGame.changePoup(1);
        $('#awardDetailBox').hide();
	}
	
	function showRule(){
        HdGame.changePoup(2);
        $('#awardDetailBox').hide();
	}
	function startBtnAjax(event){
        if(false){
            HdGame.statusMsg(2);
            hg.sound.allowPlay = false;
            hg.sound.pauseAll();
            return;
        }
		
        var that = this;
        if(!hg.fireWith('startGamehead',that,[event])){
            return;
        }
        if(false){
            HdGame.statusMsg("活动尚未发布",'最多测试人数为100人！');
            if(typeof startStatus !== 'undefined'){
                startStatus = true;
            }
            return;
        }
        if(true){
            if(hg.showGameBox){
                $('.homeBtnBox').hide();
                $('.footerBox').hide(); 
                $('.home,#ruleImg').hide();
                $('.gameBox').show();
                if(typeof hg.sound.cache[0] !== 'undefined' && typeof hg.sound.cache[0].playing !== 'undefined' && !hg.sound.cache[0].playing){
                    hg.sound.readyPlay(0,0,'loop');
                }
            }
            HdGame.logDog(1000002, 31);
            HdGame.logObjDog(1000092, 1, 29);
            hg.fireWith('startGame',that,[false,event]);
        }else{
            HdGame.statusMsg("该游戏已超过最大参与人数！");
        }
    }

		
    function gameOver(_gameScore,callBack,option){
        
		if(_gameScore === 'fail'){			
			setTimeout(function(){
				HdGame.resulePoup.show({
                    isSuc:false,
                    gameScore:"fail",//闯关失败
                    minScore:50,
                    bestScore:'无',
                    isReg:HdGame.isReg, //是否报名
                    gameType:gameType,
                    rank:0,
                    count:drawTimesLimit-count<0 ? 0:(drawTimesLimit-count),
                    isLimitDrawTotal:false,
                    totalCount: drawTotalLimit - totalCount < 0 ? 0 : (drawTotalLimit - totalCount)
                });
			},900);
			return;
		}
        if(isNaN(_gameScore) || _gameScore < 0){
            _gameScore = 0;
        }
		if(gameType == 3 && g_config.openAwardLinkNoDraw && !g_config.isRegUserName && !g_config.isRegPhone && !g_config.isRegAddress){
			HdGame.aUserInfo.show(arguments,this);
            if(g_config.contactNoDraw && $.parseJSON(g_config.contactNoDraw)[0] != -1){
                $('#awardUserInfoBox .contactInput').hide();
                $.each(g_config.contactNoDraw,function(index,value){
                    $('#awardUserInfoBox .contactInput').eq(value).show();
                })
            }else{
                $('#addressInput').hide();
            }
			return;
		}
        $('.ajaxLoadBg').show();
        $('.ajaxLoadBar').addClass('ajaxLoad');
        var _gameScoreStr = _gameScore + '';
        if(false){
            _gameScoreStr = changeTwoDecimal_f(_gameScore);
        }      
        var info = {headImg : "http://wx.qlogo.cn/mmopen/Q3auHgzwzM4DJfovSJCqebsianIvGcX6HWPFI2bROl3z9B2Bl4iavR5dfIjOqYojfvLNM8uBlkBkZ5G9MhmzcN8j2bQBnkRicEiac449loHwTsE/0"};
		g_config.awardUsername && (info.ausername = g_config.awardUsername);	
        g_config.awardPhone && (info.aphone = g_config.awardPhone);	
        g_config.awardAddress && (info.aadress = g_config.awardAddress);
        var params = {};
        params.gameId = 29;
        params.style = 22;
        params.achieve = HdGame.encodeBase64('"'+_gameScoreStr+'"') + $.md5(11203564);
        params.openId = "o1ueSjq82FnmM8jph4NlDsOH-CeY";
        params.name = "小旋风";
        
        params.info = $.toJSON(info);
        params.awardInfoB = g_config.awardInfoB;
        $.extend(params,option);
        $.ajax({
            type : 'post',
            url : '//hd.faisco.cn/ajax/hdgame_h.jsp?cmd=setAchieve&aid=11203564&playerId='+g_config.playerId,
            data : params,
            error : function(){               
                HdGame.otherAjaxComplete();
                $('#timeUpImg,.timeUpImg').removeClass('tada');
                callBack && callBack({
                    rt:-999,
                    msg:"ajax返回错误"
                });
                HdGame.tlog($.toJSON(arguments)); 
            },
            success : function(data){
                HdGame.tlog(data);                 
                var r = $.parseJSON(data);
                var isShowPoup = true;
                HdGame.otherAjaxComplete(); 
                if(r.rt == 0){
                    var arg={
                        isSuc:r.isSuc,
                        gameScore:_gameScoreStr,
                        minScore:50,
                        bestScore:r.score,
                        isReg:HdGame.isReg, //是否报名
                        gameType:gameType,
                        rank:r.rank,
                        beat:r.beat,
                        count:drawTimesLimit-count<0 ? 0:(drawTimesLimit-count),
						isLimitDrawTotal:false,
						totalCount:	drawTotalLimit-totalCount<0 ? 0:(drawTotalLimit-totalCount),
						isEqualDraw:false
                    };
                    setTimeout(function(){
                        var callBackArg = {rt:r.rt,msg:r.msg,arg:arg,pId:r.playerId}
						g_config.playerId = r.playerId;
                        if(false){
                            callBackArg.infoList = r.infoList;
                            callBackArg.arg = arg;
                        }
                        callBack && (isShowPoup = callBack(callBackArg));
                        $('#timeUpImg,.timeUpImg').removeClass('tada');
                        isShowPoup !== false && HdGame.resulePoup.show(arg);
                    },900);
                }else if(r.rt == 11){
					alert("已被检测到有作弊行为，再次被检测将永久禁止参与本游戏！");
				}else if(r.rt == 12){
					alert("由于作弊行为，该微信号已永久禁止参与本游戏！");
				}else if(r.rt == 23){
                    HdGame.statusMsg("游戏已结束。");
                }else{
                    callBack && (isShowPoup = callBack({rt:r.rt,msg:r.msg}));
                    isShowPoup !== false && HdGame.resulePoup.show({
                        isSuc:false,
                        gameScore:'--',
                        minScore:50,
                        bestScore:'--',
                        isReg:HdGame.isReg, //是否报名
                        gameType:gameType,
                        rank:'--',
                        beat:'--',
                        count:drawTimesLimit-count<0 ? 0:(drawTimesLimit-count),
                        isLimitDrawTotal:false,
                        totalCount: drawTotalLimit-totalCount<0 ? 0:(drawTotalLimit-totalCount),
                        isEqualDraw:false
                    });
                    return;
                }
                if(r.rt !== 0){
                    callBack && callBack({rt:r.rt,msg:r.msg});
                }
            }
        });
        params = info = option = null;
        function changeTwoDecimal_f(x) {
            var f_x = parseFloat(x);
            if (isNaN(f_x)) {
                alert('function:changeTwoDecimal arguments error');
                return x;
            }
            var f_x = Math.round(x * 100) / 100;
            var s_x = f_x.toString();
            var pos_decimal = s_x.indexOf('.');
            if (pos_decimal < 0) {
                pos_decimal = s_x.length;
                s_x += '.';
            }
            while (s_x.length <= pos_decimal + 2) {
                s_x += '0';
            }
            return s_x;
        }
        
    }

function checkAreaLimit(){
	var isShowMsg = true;
	if(typeof arguments[0] === 'boolean'){
		isShowMsg = arguments[0];
	}
	//限制参与地区
	if(false){ //有开启参与地区限制
		var areaLimit_province = '-1'.split(':');
		var areaLimit_city = '-1'.split(':');
		var now_province = g_config.ipInfo.provice;
		var now_city = g_config.ipInfo.city;
		//console.log(g_config.ipInfo);
		if(areaLimit_province[0] != "-1"){ //限制为全部地区的不用判断ip信息，否则判断用户是否在限制地区内
			if( now_province && now_city ){ //有查到当前ip信息
				if( areaLimit_city[0] == "-1" ){ //不限制城市，只限制省份
					if( areaLimit_province[0] != "-1" && now_province.indexOf(areaLimit_province[1]) == -1 ){ //用户不在限制的省份内
						isShowMsg && HdGame.statusMsg("该活动限制地区",'该活动仅限'+areaLimit_province[1]+'地区的用户参与');
						return 'limit';
					}
				}else{ //限制城市
					if( now_city.indexOf(areaLimit_city[1]) == -1 ){ //用户不在限制的城市内
						isShowMsg && HdGame.statusMsg("该活动限制地区",'该活动仅限'+areaLimit_city[1]+'地区的用户参与');
						return 'limit';
					}
				}
			}else{ //没有查到当前ip信息，显示服务繁忙
				isShowMsg && HdGame.statusMsg("服务繁忙，请稍候重试",'');
				return 'busyness';
			}
		}
	}
	return 'ok';
} 
var drawStatusLuckDraw = true;
function luckDraw(fn,option){


	if( checkAreaLimit() != 'ok' ){ //不在限制的地区内，直接返回
		home();
		return;
	}
	
    if(!drawStatusLuckDraw){
        return;
    }
    drawStatusLuckDraw=false;
    $('.ajaxLoadBg').show();
    $('.ajaxLoadBar').addClass('ajaxLoad'); 

    var params = {};
    params.gameId = 29;
    params.style = 22;
    
    params.userName = "小旋风";
    params.isPub = $.trim('');
    params.headImg = 'http://wx.qlogo.cn/mmopen/Q3auHgzwzM4DJfovSJCqebsianIvGcX6HWPFI2bROl3z9B2Bl4iavR5dfIjOqYojfvLNM8uBlkBkZ5G9MhmzcN8j2bQBnkRicEiac449loHwTsE/0';
    $.extend(params,option);
    $.ajax({
        type : 'post',
        url : '//hd.faisco.cn/ajax/hdgame_h.jsp?cmd=getResult&aid=11203564&openId=o1ueSjq82FnmM8jph4NlDsOH-CeY',
        data : params,
        error : function(){ 
            alert( '服务繁忙，请稍候重试!' );
            HdGame.otherAjaxComplete();
            drawStatusLuckDraw=true;
			if(gameType != 4){
				count++;
				totalCount++;
			}            
        },
        success : function(data){
            HdGame.tlog(data);
            HdGame.otherAjaxComplete(); 
            drawStatusLuckDraw=true;  
            var result = $.parseJSON(data);
            if(result.success){
				if(gameType != 4){
					count++;
					$(".dayDrawCount").text(drawTimesLimit-count<0 ? 0:(drawTimesLimit-count));
					totalCount++;
					$(".totalDrawCount").text(drawTotalLimit-totalCount<0 ? 0:(drawTotalLimit-totalCount));
				}	
                $('#resule-gift-box').attr('_level',result.awardIndex);
				g_config.haveAward = true;
				$('.resule-status-send').html("查看我的奖品");
            }else{
				if(result.rt === 27){
					$('.resuleBox').hide();
					HdGame.showLotsWait(5,function(){
						$('.resuleBox').show();
						//HdGame.resulePoup.startStatus = true; //开启摇一摇抽奖
						luckDraw(fn,option);
					});
					return;
                }else if (result.rt === 1) {
					count = drawTimesLimit;
                    $(".dayDrawCount").text(0);
					HdGame.statusMsg(4);
					if(!g_config.showHelpGuide){
                        $('#resule-gift-box').hide();
						home('luckDraw');
					}
                    return;
                }else if (result.rt === 13) {
                    HdGame.statusMsg(6);
                    count = drawTimesLimit;
                    totalCount = drawTotalLimit;
                    $(".dayDrawCount").text(0);
                    $(".totalDrawCount").text(0);
                    $('#resule-gift-box').hide();
                    home('luckDraw');
                    return;
                }else if( result.rt ===  -3 ){
                    HdGame.statusMsg("活动不存在。");
                    return;
                }else{  
                    if(result.rt === -2){
                        HdGame.tlog("参数错误。");
                    }else if(result.rt === -1){
                        HdGame.tlog("系统错误，请刷新再试。");
                    }
                    count++;
                    $(".dayDrawCount").text(drawTimesLimit-count<0 ? 0:(drawTimesLimit-count));
                    totalCount++;
                    $(".totalDrawCount").text(drawTotalLimit-totalCount<0 ? 0:(drawTotalLimit-totalCount));
                }
            }
			
            var arg={
                isSuc:result.success,
                giftStyle:result.awardStyle,
                giftName:result.awardName,
                giftCode:result.awardCode,
                awardTypeNum:result.awardTypeNum,
                giftImage:result.awardImage,
                awardImageW:result.awardImageW,
                awardImageH:result.awardImageH,
                awardIndex:result.awardIndex,
            };
            
            if(HdGame.getType(fn) === 'function'){

                fn(arg,result);
            }else{
                HdGame.resulePoup.showGift(arg);
            }
        }
    });     

}
$(function(){
    hg.fire('jsFootEnd');
})
</script>




<script type="text/javascript">
	
	$.ajaxSettings.errorCall.push(function(callbackContext, status, error){
        if(/logAjaxErr_h\.jsp/.test(callbackContext.url) && /cmd=hdajaxErr/.test(callbackContext.url)){
            return;
        }
		var faiAjax = top._faiAjax || Fai.top._faiAjax || $;
		if( faiAjax ){
			faiAjax.ajax({
				type	: "post",
				url		: "//hd.faisco.cn/ajax/logAjaxErr_h.jsp?cmd=hdajaxErr&error="+error+"&status="+status+"&openId=o1ueSjq82FnmM8jph4NlDsOH-CeY&aid=11203564&gameId=29",
				data	: 'msg=' + HdGame.encodeHtml('ajaxUrl='+HdGame.encodeUrl(callbackContext.url)+';refer='+HdGame.encodeUrl(top.location.href))
			});
		}
	});
	
</script>
</body>
</html>
